I have to implement the following functionality. See the picture.
Can I change the functionality of Navigation drawer? I haven't any found fix for my problem.
I hope you can help me, thanks in advance.
I have to implement the following functionality. See the picture.
Can I change the functionality of Navigation drawer? I haven't any found fix for my problem.
I hope you can help me, thanks in advance.
Yes it's possible. However I advise you against it because it kind of breaks the UI.
If you choose to do it though, first you need to be able to access the overflow menu (circled button). This was answered before here, so I'll just provide a style.xml snippet:
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:actionOverflowButtonStyle">@style/Overflow</item>
</style>
<style name="Overflow" parent="Widget.AppCompat.ActionBar">
<item name="android:contentDescription">OVERFLOW</item>
</style>
Then, when the home (navigation drawer) button is clicked you open the overflow menu:
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == android.R.id.home) {
final View decor = getWindow().getDecorView();
ArrayList<View> results = new ArrayList<>();
decor.findViewsWithText(results, "OVERFLOW",
View.FIND_VIEWS_WITH_CONTENT_DESCRIPTION);
if (results.size() == 1) {
results.get(0).performClick();
return true;
}
}
return super.onOptionsItemSelected(item);
}