I have some problems managing the Android status list for a button. I pointed out some Shape drwable element for different states, but I also need to change the textColor depending on the current state.
My actual list of xml states:
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape>
<gradient
android:startColor="@color/white"
android:endColor="@color/light_gray"
android:angle="270" />
<stroke
android:width="3dp"
android:color="@color/classic_red1" />
<corners
android:radius="3dp" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</shape>
</item>
<item>
<shape>
<gradient
android:startColor="@color/classic_red1"
android:endColor="@color/classic_red2"
android:angle="270" />
<stroke
android:width="2dp"
android:color="@color/white" />
<corners
android:radius="3dp" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</shape>
</item>
</selector>
I need to also change textColor based on these two states. Thanks in advance.
source
share