I have custom attribute:
<declare-styleable name="customColors">
<attr name="myColor" format="reference" />
</declare-styleable>
And I use it all over my project: In layouts, in drawables, etc.
Now I need to be able to apply any color to it in runtime, like the user should be able to choose color, and everything using ?attr/myColor
should switch to that color.
I understand that I can programmatically change the color everywhere it is used one by one, but it is really a lot of routine work to do, which I would like to avoid.
I tried researching on how to change the style attributes at runtime, but it looks to be impossible.
So the question is how to replace all usages of custom theme attribute color ?attr/myColor
with a custom color at runtime?