I want to keep the ActionBarDrawerToggle icon(hamburger) to the edge of the screen.
But by default it gives some space from the edge.
How to keeps the icon to the side of edge(basically no space).
I want to keep the ActionBarDrawerToggle icon(hamburger) to the edge of the screen.
But by default it gives some space from the edge.
How to keeps the icon to the side of edge(basically no space).
Probably too late, but ...
Actually Mike answered already similar question here Get reference to drawer toggle in support actionbar
I just reused his code. After you added the ActionBarDrawerToggle and called syncState() on it
final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
ActionBarDrawerToggle actionBarDrawerToggle = new ActionBarDrawerToggle(...);
//Setting the actionbarToggle to drawer layout
drawerLayout.setDrawerListener(actionBarDrawerToggle);
//calling sync state is necessay or else your hamburger icon wont show up
actionBarDrawerToggle.syncState();
you can iterate through children of the toolbar and then ...
for (int i = 0; i < toolbar.getChildCount(); i++) {
if(toolbar.getChildAt(i) instanceof ImageButton) {
ImageButton imageButton = (ImageButton) toolbar.getChildAt(i);
imageButton.setPadding(50, 100, 50, 50);
}
}
Hopefully it helps