This is my Custom Toolbar Layout:
<android.support.v7.widget.Toolbar android:id="@+id/toolbar"
android:layout_width="match_parent"
android:background="@color/white"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:layout_height="?attr/actionBarSize"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:contentInsetStartWithNavigation="0dp"
app:contentInsetStart="0dp"
app:layout_collapseMode="pin">
<ImageView
android:layout_width="217dp"
android:layout_gravity="center"
android:layout_centerInParent="true"
android:layout_height="match_parent"
android:src="@drawable/toll_photo" />
</android.support.v7.widget.Toolbar>
When I add the back button it changes the toolbar layout it moves it to the left!Help would be appreciated!
I include the toolbar on every activity I need it like this <include layout="@layout/toolbar_layout"/>
and on each activity I simply
<include layout="@layout/toolbar_layout"/>
toolbar= findViewById(R.id.toolbar);
toolbar.setNavigationIcon(getResources().getDrawable(R.drawable.back));
setSupportActionBar(toolbar);
Update this is my style.xml
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/white</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>