I see examples of selectors using android states like 'selected' to define style. Here a simplified example:
<selector>
<item android:state_selected="true" android:drawable="@color/transparent" />
<item android:drawable="@drawable/listitem_normal" />
</selector>
So, my question is: Can I define and use my own state instead of
android:state_selected="true"
My goal is to color shapes based on an integer value, like simple version of this heatmap:
What you originally wanted can be done with custom boolean attributes.
You can see a coded example here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With