I'm trying to style an AlertDialog to please a customer. They like the Blue title bar on Theme.Holo.Light.Dialog but like the green checkboxes from another theme. this is what I want to produce:
So, I've got a style definitions like this:
<style name="MyDialogTheme" parent="@android:Theme.Holo.Light.Dialog">
<item name="android:listChoiceIndicatorMultiple">@drawable/checkbox_green</item>
</style>
<style name="mycheckbox" parent="@android:style/Widget.CompoundButton.CheckBox">
<item name="android:button">@drawable/checkbox_box</item>
</style>
and I've got a definition for checkbox_green as follows which are just PNG files:
<item android:state_checked="false"
android:drawable="@drawable/checkbox_unchecked" />
<item android:state_checked="true"
android:drawable="@drawable/checkbox_checked"/>
</selector>
and I create my dialog builder with a specific theme in Java like so:
ContextThemeWrapper ctw = new ContextThemeWrapper( mContext, R.style.MyDialogTheme);
AlertDialog.Builder builder= new AlertDialog.Builder( ctw );
But I cannot get the dialog to display green checkboxes instead of the blue in this theme. I get this:
I could go ahead and create an entire layout and then use that like this:
AlertDialog shareDialog = new AlertDialog.Builder(mContext).create();
LayoutInflater inflater = MainActivity.this.getLayoutInflater();
View dialogView = null;
dialogView = inflater.inflate(R.layout.share, (ViewGroup) getCurrentFocus());
shareDialog.setView(dialogView);
but that requires styling all of the dialog, not just the checkboxes.It seems so much simpler to just re-style the checkboxes but I'm not able to make that work.
what must I do, other than to create a complete layout and use to get the green checkboxes rather than the blue?