lundi 27 juin 2016

Different states for Android checkbox

I'd like to implement different validation states for all input controls, but I have some problems with checkbox and radio buttons. It should be possible to recolor programmatically these controls to red, yellow and green depending the state, which is set.

So is it possible to retrieve the current shown drawable of the checkbox control by programcode, so I can recolor it with a color filter? Or is it possible to add some kind of effect around the checkbox to show its state? It doesn't have to be the checkbox it self, but it shouldn't be an additional control.

I know I could create a drawable for each state and set it as a background, but I'd like to avoid this because it would be additional work for each style I'd like to support (Android 4, 5 and some custom).




Aucun commentaire:

Enregistrer un commentaire