Android Question Can StateListDrawable control the Button's Text Color?

Widget

Well-Known Member
Licensed User
Longtime User
My buttons have a transparent background and I want the button text to have 3 colors that indicates the state of the button:

Enabled : Button.TextColor = Black
Disabled: Button.TextColor = Gray
Pressed : Button.TextColor = Yellow

From the tutorial on StateListDrawable https://www.b4x.com/android/forum/threads/statelistdrawable-example.6589/ it appears StateListDrawable can control only the background color of the view (in my case it is a button) and its corner radius.

Is there a way to use a StateListDrawable to control the color of the button's text?
Or am I forced to do this manually using code?

TIA
 
Top