vendredi 4 mars 2016

How to find out the drawable resource being used on a checkbox

How can I find out which stock drawable resource is being used for a checkbox?

If I create a checkbox and leave the button drawable untouched in the XML or the Android Studio properties bar then I get a checkbox that looks like below:

enter image description here

I'd like to know what that drawable is because it has a nice animation when the state of the checbox changes from unchecked to checked.

Looking through the drawable resources that come with Android Studio as standard it seems like android.R.drawable.checkbox_off_background is the only default checbox, but this isn't the one shown above - checkbox_off_background looks like below:

enter image description here

Two questions, then:

  1. How can I find which drawable is being used for the checkbox in the top screenshot so that I can use it elsewhere?

  2. How would I trigger the animation between the checked and unchecked versions of the drawable if it wasn't being used as a checbox button drawable?




Aucun commentaire:

Enregistrer un commentaire