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
Show 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;
...
@@ -3,9 +3,8 @@ package chat.rocket.android.activity;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.support.annotation.Nullable
;
import
android.support.annotation.Nullable
;
import
android.support.design.widget.Snackbar
;
import
android.support.design.widget.Snackbar
;
import
android.support.graphics.drawable.VectorDrawableCompat
;
import
android.support.v4.widget.SlidingPaneLayout
;
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.support.v7.widget.Toolbar
;
import
android.view.View
;
import
android.view.View
;
...
@@ -45,7 +44,6 @@ public class MainActivity extends AbstractAuthedActivity {
...
@@ -45,7 +44,6 @@ public class MainActivity extends AbstractAuthedActivity {
setContentView
(
R
.
layout
.
activity_main
);
setContentView
(
R
.
layout
.
activity_main
);
statusTicker
=
new
StatusTicker
();
statusTicker
=
new
StatusTicker
();
setupToolbar
();
setupSidebar
();
setupSidebar
();
if
(
roomId
==
null
)
{
if
(
roomId
==
null
)
{
showFragment
(
new
HomeFragment
());
showFragment
(
new
HomeFragment
());
...
@@ -109,33 +107,32 @@ public class MainActivity extends AbstractAuthedActivity {
...
@@ -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
toolbar
=
(
Toolbar
)
findViewById
(
R
.
id
.
activity_main_toolbar
);
toolbar
.
setNavigationIcon
(
drawerArrowDrawable
);
toolbar
.
setNavigationOnClickListener
(
view
->
{
toolbar
.
setNavigationOnClickListener
(
view
->
{
if
(
pane
.
isSlideable
()
&&
!
pane
.
isOpen
())
{
if
(
pane
.
isSlideable
()
&&
!
pane
.
isOpen
())
{
pane
.
openPane
();
pane
.
openPane
();
}
}
});
});
}
private
void
setupToolbar
()
{
Toolbar
toolbar
=
(
Toolbar
)
findViewById
(
R
.
id
.
activity_main_toolbar
);
setSupportActionBar
(
toolbar
);
ActionBar
actionBar
=
getSupportActionBar
();
//ref: ActionBarDrawerToggle#setProgress
if
(
actionBar
==
null
)
{
pane
.
setPanelSlideListener
(
new
SlidingPaneLayout
.
PanelSlideListener
()
{
return
;
@Override
public
void
onPanelSlide
(
View
panel
,
float
slideOffset
)
{
drawerArrowDrawable
.
setProgress
(
slideOffset
);
}
}
actionBar
.
setDisplayShowTitleEnabled
(
false
);
@Override
public
void
onPanelOpened
(
View
panel
)
{
if
(
findViewById
(
R
.
id
.
sliding_pane
)
==
null
)
{
drawerArrowDrawable
.
setVerticalMirror
(
true
);
return
;
}
}
actionBar
.
setDisplayShowHomeEnabled
(
true
);
@Override
actionBar
.
setDisplayHomeAsUpEnabled
(
true
);
public
void
onPanelClosed
(
View
panel
)
{
actionBar
.
setHomeAsUpIndicator
(
drawerArrowDrawable
.
setVerticalMirror
(
false
);
VectorDrawableCompat
.
create
(
getResources
(),
R
.
drawable
.
ic_menu_black_24dp
,
null
));
}
});
}
}
private
boolean
closeSidebarIfNeeded
()
{
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