I am using com.google.android.material.appbar.AppBarLayout along with androidx.appcompat.widget.Toolbar in my app and in Android 8 it works perfectly but I am having an issue where the 'hamburger' menu icon and 'back' icons are just displaying as a white block in android 7 (API 24 & API 25) even though other menu icons are displayed correctly.
Where the hamburger icon is showing.

And what the back button looks like.

My app bar layout:
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/activity_drawer_layout_app_bar_layout"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary" />
</com.google.android.material.appbar.AppBarLayout>
And just setting up the toolbar:
setSupportActionBar ( toolbar )
actionBar?.setDisplayShowCustomEnabled(true)
actionBar?.setDisplayShowCustomEnabled(true)
actionBar?.setDisplayHomeAsUpEnabled(true)
actionBar?.setDisplayShowHomeEnabled(true)
actionBar?.setDisplayShowTitleEnabled(true)
As you are using Material library this is the expected result. I don't know how the compiler in Android 8 override the material theme settings by default. If you use material library color tints are by default applied. For more details have a look at https://material.io/design/color/applying-color-to-ui.html#usage.
You will learn everything about Material library at that website.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With