Ghost_Stark Ghost_Stark - 9 months ago 205
Android Question

Remove large padding after hamburger (menu) icon in Android Toolbar?

Here is a picture of the large padding gap after the menu icon:
enter image description here

This occurred after not working on my project for a month (summer school). I just came back to it and noticed this larger than normal gap on the toolbar after I updated Android Studio. I can't find any questions/solutions about this on SO. If anyone can help that would be very much appreciated.

I am loading the hamburger icon by doing this (each line is properly placed in the app, in either the class declaration, onCreate(), etc. I put it like this for simplicity.):

ActionBarDrawerToggle mDrawerToggle;
mDrawerToggle = new ActionBarDrawerToggle(getActivity(), dl, toolbar, R.string.nav_open, R.string.nav_closed)

Here is the xml code for my toolbar:

app:title="Test Title">


I tried messing around with the various
xml attributes but none affected the spacing after the menu icon.

EDIT: This link shows what I used to have (found around the middle of the page). If you notice the spacing between the title and the hamburger icon, the spacing is not as wide as in the picture shown here. It's as if the spacing got doubled or something.


I figured it out! I had to set


in my Toolbar layout. It was the one I had not tried ha. It's weird I had to add that but it works like before :]

enter image description here