I want to change button's style between 3 drawables : "normal", "green" and "red". I used TransitionDrawable, but it works only with 2 layers.
<transition xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/button" />
<item android:drawable="@drawable/buttongreen" />
</transition>
How would I implement another "android:drawable" or is there other way to achieve this, else than TransitionDrawable? How to switch between drawables, based on input (0 - stands for red, 1 - for green)?
The constructor for TransitionDrawable takes an array, which may contain more than two drawables, as per the documentation
Though I haven't used this class, so in case it doesn't work, you can set up two TransitionDrawables, one for the transition from color A to B, and another for B to C. Then you'll have to call start on the second transition after the end of the first, and it'll look like it's transitioning from A to B to C.