I'm building a selector for button, with a state list drawable,
states.addState(new int[] {android.R.attr.state_checked},
checkedDrawable.getDrawable());
states.addState(new int[] {},
unCheckDrawable.getDrawable());
What should I put in second state ? there is no android.R.attr.state_unchecked
This question might help you.
It says, that you should use the negative of the state you need. So in your case it should be:
states.addState(new int[] {-android.R.attr.state_checked}, unCheckDrawable.getDrawable());
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