I have a specific need to texcolorlist put the drawable with the background button. My textColor:
<?xml version="1.0" encoding="UTF-8" ?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:color="@android:color/black" />
<item android:state_checked="true" android:color="@android:color/black" />
<item android:color="#8e000000"/>
</selector>
My Button State:
<?xml version="1.0" encoding="UTF-8" ?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<gradient
android:angle="90"
android:endColor="#005b7f"
android:startColor="#051725"/>
<corners android:radius="5dp"/>
</shape>
</item>
<item>
<shape android:shape="rectangle">
<gradient
android:angle="90"
android:endColor="#e6e6e6"
android:startColor="#b3b3b3"/>
<corners
android:bottomLeftRadius="5dp"
android:bottomRightRadius="5dp"
android:topLeftRadius="5dp"
android:topRightRadius="5dp"/>
</shape>
</item>
</selector>
I know that in this way I can put the button color: android:textColor="@drawable/button_text_color"
I wonder if the button text color can be put directly into My Button State. This is something, but it does not work:
<?xml version="1.0" encoding="UTF-8" ?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape
android:shape="rectangle"
android:textColor="#000000">
<gradient
android:angle="90"
android:endColor="#e6e6e6"
android:startColor="#b3b3b3"/>
<corners
android:bottomLeftRadius="5dp"
android:bottomRightRadius="5dp"
android:topLeftRadius="5dp"
android:topRightRadius="5dp"/>
</shape>
</item>
</selector>