I'm facing an issue on devices with a separate menu key (like the Samsung onces). In some Activities the textcolor of the Overflow Menu Items is white when opened via the Menu-Key. Opening the Overflow via the three dots the textcolor is always black - like it should be.
Following a Screenshot which visualizes the issue. On the left side the everything is fine, overflow has been opened via the three dots. On the right side the menu has been opened via the Menu-Key:
<style name="AppThemeToolbar" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/primary_color</item>
<item name="colorPrimaryDark">@color/primary_color_dark</item>
<item name="colorAccent">@color/accent_color</item>
<item name="android:textColorPrimary">@android:color/white</item>
<item name="android:textColorSecondary">@android:color/white</item>
<item name="windowActionModeOverlay">true</item>
<item name="actionModeBackground">@color/action_mode_color</item>
<item name="actionBarPopupTheme">@style/ThemeOverlay.AppCompat.Light</item>
</style>
Note: I'm using the exact same Theme in multiple Activities though in 3 out of 5 everything is fine. That's totally mind boggling and doesn't make sense.
So basically the question is: How can I fix this and why is the textcolor in some activities black and in others white (while they're all using the same Theme)?
What I've tried (found in other similar posts):
panelBackground
. This works, unfortunately this isn't a solution for me since the textcolor switches at will between black and white - so there's simply no good background color I could set.android:panelTextAppearance
textAppearanceSmallPopupMenu
textAppearanceLargePopupMenu
popupMenuStyle
android:actionMenuTextColor
& actionMenuTextColor
Finally found the solution!
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="actionBarPopupTheme">@style/HardwareOptionMenu</item>
</style>
<style name="HardwareOptionMenu" parent="ThemeOverlay.AppCompat.Dark">
<item name="android:textColorSecondary">@color/white</item>
<item name="android:colorBackground">@color/black</item>
</style>
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