2

Want to change Navigation Icon Position to 8dp left.

I have attach the screenshot

  • Black Colour line is the Current Position.

  • Orange Colour line is the position where, I want my Navigation icon to be placed.

Things I have implemented so far are.

<android.support.v7.widget.Toolbar
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:layout_gravity="center"
    android:background="?attr/colorPrimary"
    android:clipToPadding="false"
    android:gravity="center|start"
    app:contentInsetLeft="0dp"
    app:contentInsetStart="0dp"
    android:contentInsetLeft="0dp"
    android:contentInsetStart="0dp"
    app:navigationIcon="@drawable/arrow"/>

and

    if (actionBar != null) {
        // Tried Both
        actionBar.setHomeButtonEnabled(true); & actionBar.setHomeButtonEnabled(false);
        toolbar.setContentInsetsAbsolute(0, 0);
    }

enter image description here

Abhishek
  • 2,350
  • 2
  • 21
  • 35
  • with toolbar there is a default margin from left , I don't know exactly how much but there is . Try making this with normal views like Relative or Linear Layout – Vivek Mishra Apr 20 '16 at 05:37
  • Thanks Vivek (: .. Well I am not looking for alternative solution because I am facing same issue in my other screens like with coordination layout. – Abhishek Apr 20 '16 at 06:02
  • http://stackoverflow.com/questions/26455027/android-api-21-toolbar-padding see this link then – Vivek Mishra Apr 20 '16 at 06:10
  • Dude check my implemented so far code.. I have implemented that solution. – Abhishek Apr 20 '16 at 06:14
  • My main motive to share that link to show how much is the default padding in toolbar. And I also searched and I think creating custom toolbar is the only solution – Vivek Mishra Apr 20 '16 at 06:16

1 Answers1

3

please try adding

        android:paddingLeft="-8dp"

or

        android:layout_marginLeft="-8dp"

this will work.

Jaydeep Devda
  • 727
  • 4
  • 18