This removes the left margin from the toolbar.
mainToolbar.setContentInsetsAbsolute(0, 0);
Or you can set the left insert to 0dp in the xml toolbar:
android:contentInsetLeft="0dp"
Another way is to define this addition in styles.xml:
<style name="ToolbarStyle" parent="@style/Widget.AppCompat.Toolbar"> <item name="contentInsetStart">0dp</item> <item name="android:contentInsetStart">0dp</item> </style>
If all these solutions do not work, check to see if the image has its own add-on.
source share