vendredi 19 février 2016

Android default control styles

I'm using a few CheckBox controls to indicate passing and failing of checks when an app launches.

If I leave the CheckBoxes with all of their default style (other than changing the textColor to #0000ff) the boxes appear exactly as I want them to - as below:

default checkbox images

The CheckBox status is unchecked until a test is carried out, checked in the test passes and if a test fails I change the background to a different image resource to display a red cross.

In the screenshot above the first test is passed and the second and third tests have not been run yet.

If a test fails I give the user an option to retry the tests which resets the CheckBox backgrounds to android.R.drawable.checkbox_off_background to remove any of the red crosses, however this doesn't set the checkbox drawable to what they were before, it sets them to a different checkbox image as shown below.

android.R.drawable.checkbox_off_background checkbox images

I want to revert to the original images as displayed if I don't change anything programatically, but the default Android images don't seem to be the right ones. Where can I find the correct ones or revert to the correct ones?




Aucun commentaire:

Enregistrer un commentaire