Actionbar background style not changing in dark theme

Viewed 154

Creating the first app, I changed the actionbar's background to teal.

The problem is that it worked on light theme but not on dark theme.

Tested on both pixel 3 XL emulator and 2 different samsung devices.

How to custom an app's actionbar title for dark theme devices?

Working light theme (.../res/values/themes.xml): (See screencap below)

<resources xmlns:tools="http://schemas.android.com/tools">
    <style name="Theme.HappyBirthday" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
        <item name="colorPrimary">@color/teal_200</item>
    </style>
</resources>

Not Working dark theme (.../res/values-night/themes.xml): (See screencap below)

<resources xmlns:tools="http://schemas.android.com/tools">
    <style name="Theme.HappyBirthday" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
        <item name="colorPrimary">@color/teal_200</item>
    </style>
</resources>

Working Light theme Screencap:

enter image description here

Not working dark theme screencap:

enter image description here

0 Answers
Related