Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
28d63853
Commit
28d63853
authored
Jan 12, 2017
by
Yusuke Iwaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify humberger icon to use DrawerArrowDrawable (refer to ActionBarDrawerToggle)
parent
a32869da
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
30 deletions
+18
-30
MainActivity.java
.../main/java/chat/rocket/android/activity/MainActivity.java
+18
-21
ic_menu_black_24dp.xml
app/src/main/res/drawable/ic_menu_black_24dp.xml
+0
-9
No files found.
app/src/main/java/chat/rocket/android/activity/MainActivity.java
View file @
28d63853
...
...
@@ -3,9 +3,8 @@ package chat.rocket.android.activity;
import
android.os.Bundle
;
import
android.support.annotation.Nullable
;
import
android.support.design.widget.Snackbar
;
import
android.support.graphics.drawable.VectorDrawableCompat
;
import
android.support.v4.widget.SlidingPaneLayout
;
import
android.support.v7.
app.ActionBar
;
import
android.support.v7.
graphics.drawable.DrawerArrowDrawable
;
import
android.support.v7.widget.Toolbar
;
import
android.view.View
;
...
...
@@ -45,7 +44,6 @@ public class MainActivity extends AbstractAuthedActivity {
setContentView
(
R
.
layout
.
activity_main
);
statusTicker
=
new
StatusTicker
();
setupToolbar
();
setupSidebar
();
if
(
roomId
==
null
)
{
showFragment
(
new
HomeFragment
());
...
...
@@ -109,33 +107,32 @@ public class MainActivity extends AbstractAuthedActivity {
}
});
final
DrawerArrowDrawable
drawerArrowDrawable
=
new
DrawerArrowDrawable
(
this
);
Toolbar
toolbar
=
(
Toolbar
)
findViewById
(
R
.
id
.
activity_main_toolbar
);
toolbar
.
setNavigationIcon
(
drawerArrowDrawable
);
toolbar
.
setNavigationOnClickListener
(
view
->
{
if
(
pane
.
isSlideable
()
&&
!
pane
.
isOpen
())
{
pane
.
openPane
();
}
});
}
private
void
setupToolbar
()
{
Toolbar
toolbar
=
(
Toolbar
)
findViewById
(
R
.
id
.
activity_main_toolbar
);
setSupportActionBar
(
toolbar
);
ActionBar
actionBar
=
getSupportActionBar
();
if
(
actionBar
==
null
)
{
return
;
}
actionBar
.
setDisplayShowTitleEnabled
(
false
);
//ref: ActionBarDrawerToggle#setProgress
pane
.
setPanelSlideListener
(
new
SlidingPaneLayout
.
PanelSlideListener
()
{
@Override
public
void
onPanelSlide
(
View
panel
,
float
slideOffset
)
{
drawerArrowDrawable
.
setProgress
(
slideOffset
);
}
if
(
findViewById
(
R
.
id
.
sliding_pane
)
==
null
)
{
return
;
}
@Override
public
void
onPanelOpened
(
View
panel
)
{
drawerArrowDrawable
.
setVerticalMirror
(
true
);
}
actionBar
.
setDisplayShowHomeEnabled
(
true
);
actionBar
.
setDisplayHomeAsUpEnabled
(
true
);
actionBar
.
setHomeAsUpIndicator
(
VectorDrawableCompat
.
create
(
getResources
(),
R
.
drawable
.
ic_menu_black_24dp
,
null
));
@Override
public
void
onPanelClosed
(
View
panel
)
{
drawerArrowDrawable
.
setVerticalMirror
(
false
);
}
});
}
private
boolean
closeSidebarIfNeeded
()
{
...
...
app/src/main/res/drawable/ic_menu_black_24dp.xml
deleted
100644 → 0
View file @
a32869da
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24.0"
android:viewportHeight=
"24.0"
>
<path
android:pathData=
"M3,18h18v-2L3,16v2zM3,13h18v-2L3,11v2zM3,6v2h18L21,6L3,6z"
android:fillColor=
"#000000"
/>
</vector>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment