The ActionBar has two icons, one is the "Overflow" icon at the rightmost, the other is the "Home" icon (Three horizontal lines icon) at the leftmost.
The color of the ActionBar "Overflow" (Rightmost) icon can be changed by the following style:
<style name="ActionBarOverflowStyle" parent="@style/Widget.AppCompat.ActionButton.Overflow" >
<item name="android:tint">@color/red</item>
</style>
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:actionOverflowButtonStyle">@style/ActionBarOverflowStyle</item>
</style>
But how to change the color of "Home" icon at the leftmost by using XML style?
Also when navigating to the next fragment, the "Back" icon will appear in the ActionBar, how to change the color of "Back" icon at the leftmost by using XML style?
Here is the layout xml:
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.PopupOverlay">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:popupTheme="@style/AppTheme.AppBarOverlay" />
</com.google.android.material.appbar.AppBarLayout>
Here is the style xml:
<style name="MyThemeOverlay_Toolbar" parent="@style/ThemeOverlay.MaterialComponents.ActionBar">
<item name="android:tint">@color/red</item>
<item name="android:iconTint">@color/red</item>
<item name="android:colorControlNormal">@color/red</item>
</style>
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:actionOverflowButtonStyle">@style/ActionBarOverflowStyle</item>
<item name="android:actionBarStyle">@style/MyThemeOverlay_Toolbar</item>
</style>
The color of "Menu" icon can't be changed with this style configuration.
Thanks.