It there any analog of level-list for colors on Android?

865 views Asked by At

I am trying to find a way to give a user the possibility to switch between different color schemes (that includes different colors and images). All schemes are predifined, i.e. compiled and located inside the app. As I can see, for drawables I can do this by using level-list where each level corresponds to one scheme. But what about colors? Is there any way to do the same for colors? Or maybe there is a better way to implement color schemes switching?

2

There are 2 answers

2
Vladimir Ivanov On

You can use built-in mechanism of styles and themes.

0
a.ch. On

Try using ColorStateList which you can retrieve with getResources().getColorStateList(id)