Android: How to update state of one view based on the state of other -


i facing issue solution might simple one, tries have not succeeded.
have parent view container contains 3 child views have on onclick event handlers declared , perform different actions.
trying add statelist drawables each of these different states colors of child views change.
looks -
enter image description here

child view 3 has own statelist , works independently , have need.
however, want state of child view 1 , 2 should change simultaneously when state of either changed while perform independent actions on click. basically, if pressing (pressed state) child view 1 changes color maybe, same should happen 2 , vice versa. while, child view 3 should unaffected.
tried number of ways workaround statelist drawables no success. can please me out issue?
believe there should elegant way handle in android.
thanks!

how implement interface, kinda:

onstatechangelistener() {     onstatechanged(int color, int whatever); } 

for both of related views , listen each other state changing.


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -