Before asking this question, I have researched a bit on it and also looked for similar questions on SO, none of which seemed to answer it.
I am planning to provide visual accessibility feature in my android app where users will be able to negate the color of UI in one go(lets say a simple button to negate the colors).
There are few exceptions though. There are few views(say action bar) whose color is better to be fixed even if user chooses to negate the color, for readability.
I can think of few options to achieve the same:
- Maintain two copies of each layout xml - one with normal colored views and one with negated colored views. Now, whenever user chooses to negate the colors, just load the corresponding xml in java.
- Maintain two copies of color of each view in color.xml. Define them under two separate themes. Now set the corresponding theme based on what user wants.
Challenges:
Scalability: Given that the app is already using hundreds of views, hundreds of XML, and it is going to be using more and more views in future updates, how can I take care of that?
Questions:
1. Which option would be better for this keeping scalability in mind.
2. Is there any other way of doing the same?
3. Is there any android API which gives the negated color of a view?