The simplest (and best) way to change the color of the back/up-arrow. Best part is that there are no side-effects (unlike the other answers)!
Widget.AppCompat.DrawerArrowToggle
, define the color
and any other attributes you'd like.drawerArrowStyle
attribute in the apps Theme.Create style:
<style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
<!-- Set that the nav buttons will animate-->
<item name="spinBars">true</item>
<!-- Set the color of the up arrow / hamburger button-->
<item name="color">@color/white</item>
</style>
Set the style in App Theme:
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<!-- Change global up-arrow color with no side-effects -->
<item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
</style>
To change the ToolBar
text color (and other attributes), create this style
:
<style name="ToolbarStyle" parent="Widget.AppCompat.Toolbar">
<item name="android:textColor">@color/white</item>
<item name="titleTextColor">@color/white</item>
<item name="colorControlNormal">@color/white</item> <!-- colorControlNormal is Probably not necessary -->
</style>
Then set that style on the AppTheme:
<!-- Base application theme. -->
<style name="AppTheme.MyProduceApp" parent="Theme.MaterialComponents.Light.NoActionBar.Bridge">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<!-- Style the toolbar (mostly the color of the text) -->
<item name="toolbarStyle">@style/ToolbarStyle</item>
<!-- Change color of up-arrow -->
<item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
</style>