I have an accent color that I use through out my layouts. I have it defined as a style that I apply to a TextView.
My application lets the user choose between a dark theme and a light theme. I would like to tweak the accent color based on the selected theme.
- You can't define a color in a theme
- You can't define a state list color based on theme
- You can't separate resources based on theme (as you can for version or screen size)
- You can't update the resource color from code (??? not 100% on this ???)
How should I control my accent color based on the selected theme?
The dev guide gives an example of a theme using a custom color, which is close to what I want. I need to be able to change the color at runtime. I know I could go into my code and the X places where this style is being used I could ferrit out the component and set the color that way. But I would think I could accomplish this with some combination of style/theme.
Thanks