Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reduce padding between navigation icon and logo on my toolbar

Does anyone know how to reduce the padding between de navigation icon and logo on a toolbar. for some reason it seems like there is way more space between them then between my logo and title.

I've already tried to add a style and use contentInset but none of them seem to work.

My layout

<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/background_grey"
android:style="@style/ToolbarTheme"
android:contentInsetLeft="0dp"
android:contentInsetStart="0dp"
app:logo="@drawable/ic_launcher">

</android.support.v7.widget.Toolbar>

My style

<style name="ToolbarTheme" parent="Theme.AppCompat">
    <item name="android:minWidth">0dip</item>
    <item name="android:paddingLeft">0dip</item>
    <item name="android:paddingRight">0dip</item>
</style>

Image (Space indicated by red lines should be smaller)

like image 256
Jason Lie Avatar asked Dec 05 '22 02:12

Jason Lie


1 Answers

If you are interested only in Reducing padding between navigation icon and logo on my toolbar, use Toolbar.setContentInsetStartWithNavigation(0)

Unlike contentInsetStart, this will modify the inset only when there is a Navigation Icon. In the absence of the Navigation Icon, you will still have the 16dp start inset.

like image 106
Henry Avatar answered Feb 23 '23 20:02

Henry