Change toolbar back arrow color
You can override the theme in your Toolbar
.
With a Material Components theme:
<com.google.android.material.appbar.MaterialToolbar
style="@style/Widget.MaterialComponents.Toolbar.Primary"
android:theme="@style/MyThemeOverlay_Toolbar"
..>
with:
<style name="MyThemeOverlay_Toolbar2" parent="ThemeOverlay.MaterialComponents.Toolbar.Primary">
<!-- This attributes is used by navigation icon and overflow icon -->
<item name="colorOnPrimary">@color/secondaryColor</item>
</style>
With an AppCompat theme:
<android.support.v7.widget.Toolbar
android:theme="@style/myToolbarTheme"
...
>
Then in your theme you can define the colorControlNormal
attribute:
<style name="" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
....
<item name="colorControlNormal">@color/myColor</item>
</style>
Be mindful of the theme you use. If you copied your ToolBar code from https://developer.android.com/training/appbar/setting-up, then you have this:
<android.support.v7.widget.Toolbar
android:id="@+id/my_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:elevation="4dp"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>
Based on @Gabriele's answer (upvoted), I had to take out the android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
attribute and put it in styles.xml
then customize the colorControlNormal
attribute like so:
<style name="ToolBarTheme" parent="ThemeOverlay.AppCompat.ActionBar">
<item name="colorControlNormal">@color/white</item>
</style>
Back to my Toolbar declaration, I modified as below:
<android.support.v7.widget.Toolbar
...
android:theme="@style/ToolBarTheme"
/>
Cheers!