In light mode I have no problems because everything is correct but in dark mode without making any changes the text remains dark. Is it an Android bug? I have tried various methods but my problem is that I have to disable some menu options and then I lose the color in disabled mode, it always seems enabled. Is it just my problem? In this way the text is illegible I use this theme: Theme.MaterialComponents.DayNight.DarkActionBar
Default dark text color in dark mode on the action bar
90 views Asked by Davide Torchia At
2
There are 2 answers
3
On
Well, if you don't want the color to when user switch in dark/light mode then remove the night-theme file from res>values
and add change this in remained theme file
<style name="app_name" parent="Theme.MaterialComponents.DayNight.NoActionBar">
into
<style name="app_name" parent="Theme.MaterialComponents.Light.NoActionBar">
if your parent is different than than change it into oneof light mode of it
You might be reading the colors for both dark and light mode from the same color resource. You need to create another color resource file for dark values and then it should automagically work.
And I am not sure if
DarkActionBar
is the right one to put there on the theme.You should have something like this: