I am facing this issue for which the solution might just be a simple one, but my tries have not succeeded.
I have a parent view container which contains three child views which have their on onClick event handlers declared and perform different actions.
What I am trying to do is add statelist drawables to each of these so that for different states the colors of the child views change.
This is what it looks like roughly -
Child View 3 has it own statelist and works independently and I have what I need.
However, what I want is the state of child view 1 and 2 should change simultaneously when the state of either is changed while they perform their independent actions on click. So basically, if I am pressing (pressed state) child view 1 which changes its color maybe, the same should happen for 2 as well and vice versa. All this while, child view 3 should be unaffected.
I tried a number of ways to workaround with statelist drawables but with no success. Can anyone please help me out with this issue?
I believe there should be some elegant way to handle this in Android.
Thanks!
Enregistrer un commentaire