I want to change the TextColor depending on the state of the button (as it is seen here) in the same way I can change the background.
The problem is if I try to asign a StateListDrawable to TextColor property, it fails because it expects an Int:
java.lang.NumberFormatException: (StateListDrawable) android.graphics.drawable.StateListDrawable@40531340
I think it might be doable with the reflection library. But I don't know how. Can anybody help me with this?
Attached is the minimal example.
UPDATE 2014-09-24:
After solving this, I share a complete example where both text and background colors change using statelistdrawable.
The problem is if I try to asign a StateListDrawable to TextColor property, it fails because it expects an Int:
java.lang.NumberFormatException: (StateListDrawable) android.graphics.drawable.StateListDrawable@40531340
I think it might be doable with the reflection library. But I don't know how. Can anybody help me with this?
Attached is the minimal example.
UPDATE 2014-09-24:
After solving this, I share a complete example where both text and background colors change using statelistdrawable.
Attachments
Last edited: