Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting Theme.Holo.Light changes everything except checkboxes in list

<style name="CustomTheme" parent="@android:style/Theme.Holo.Light">

I made my own theme and added a reference to it in my manifest. Everything looks perfect (buttons, textboxes etc) except for the checkboxes in my custom list.

    android:checkMark="?android:attr/listChoiceIndicatorMultiple"

The checkbox in my listitem is the default checkbox from Theme.Holo and I can't figure out why.

Grateful for any help!

like image 526
notBanana Avatar asked Jan 19 '23 14:01

notBanana


2 Answers

I am having the same problem. I have no idea why it isn't choosing the correct checkbox - you can barely see it on the light background. For now, I copied the appropriate holo light checkbox images out the of the android drawable folders and into my project. I then created my own that referenced these images. I then set the android:button attribute to my new selector xml. My selector xml looks like this:

<selector xmlns:android="http://schemas.android.com/apk/res/android" >
        <item android:state_checked="true" android:state_focused="true"
                android:drawable="@drawable/btn_check_on_focused_holo_light" /> 
        <item android:state_checked="false" android:state_focused="true"
                android:drawable="@drawable/btn_check_off_focused_holo_light" />
        <item android:state_checked="false"
                android:drawable="@drawable/btn_check_off_holo_light" />
        <item android:state_checked="true"
                android:drawable="@drawable/btn_check_on_holo_light" />
</selector>

Make sure you copy all of the different density images (xhdpi, hdpi, etc.) into your project.

like image 93
Josh Hunt Avatar answered Apr 27 '23 02:04

Josh Hunt


The same thing happened to me but with radio buttons, as henry000 wrote.

I downloaded the original holo-light themed radiobuttons images and XML layouts from http://android-holo-colors.com/

like image 35
MDT Avatar answered Apr 27 '23 00:04

MDT