One of the ways you can do this is to use your own check images in the CheckBox
. You'll need images for the different states which you can obtain from http://android-holo-colors.com/
Then we can reference these drawables in our code as:
Drawable mEnabledBg = getResources().getDrawable(R.drawable.check_bg_enabled);
Drawable mCheckedBg = getResources().getDrawable(R.drawable.check_bg_checked);
Drawable mDisabledBg = getResources().getDrawable(R.drawable.check_bg_disabled);
Now, we use them in a StateListDrawbles
:
StateListDrawable tickColorStates = new StateListDrawable();
tickColorStates.addState(new int[]{android.R.attr.state_checked}, mCheckedBg); //checked
tickColorStates.addState(new int[]{-android.R.attr.state_checked, android.R.attr.state_enabled}, mEnabledBg); //un-checked
tickColorStates.addState(new int[]{-android.R.attr.state_enabled}, mDisabledBg); //disabled
checkBox.setButtonDrawable(tickColorStates);
Of course this setup can also be done in xml and you'll simply need to call setButtonDrawable()
then. Hope this helps.