Android ActionBar Overflow Checkbox Element

In my application, I have a custom checkbox for checkboxes, and it works by default in common areas of the interface, however it does not show up in the overflow menu when there is a checkbox, instead it shows the default holo checkbox!

enter image description here

Here is an example of a custom checkbox enter image description here

Here's how I managed to create an overflow menu (was hard), I'm looking for a style like this that will override the checkbox

<style name="OverflowMenu" parent="@style/Widget.Sherlock.ListPopupWindow">
    <item name="android:popupBackground">@drawable/pop_dark</item>
</style>

<style name="DropDownListView" parent="@android:style/Widget.Holo.ListView.DropDown">
    <item name="android:divider">@android:color/transparent</item>
</style>

      

+3


source to share


1 answer


If you override android:listChoiceIndicatorMultiple

in your theme, this applies to all checkboxes, both in the normal UI and in popup menus, i.e.

<style name="AppTheme" parent="android:Theme...">
    <item name="android:listChoiceIndicatorMultiple">@style/YourCheckBoxStyle</item>
</style>

      

If you only want to check the checkboxes in the ActionBar, you can use android:actionBarWidgetTheme

as API 14:



<style name="AppTheme" parent="android:Theme...">
    <item name="android:actionBarWidgetTheme">@style/MyActionBarWidgetScheme</item>
</style>
...
<style name="ActionBarWidgetTheme" parent="android:Widget">
    <item name="android:listChoiceIndicatorMultiple">@drawable/YourCheckBoxStyle</item>
</style>

      

(Kudos Daniel Lew pointing out that one is .)

+3


source







All Articles