Well as the title says, i'm using the actionBarSherlock library and a light theme, and sometimes I need to show a dialog using the alertDialog.Builder class.
Thing is, no matter what I try, the theme doesn't apply to the dialog itself. The theme should work on both new APIs and old ones (prior to honeycomb).
example:
code:
final AlertDialog.Builder builder = new AlertDialog.Builder(new ContextThemeWrapper(activity,
R.style.AppTheme_LightDialog));
or:
final AlertDialog.Builder builder = new AlertDialog.Builder(new ContextThemeWrapper(activity,
R.style.Theme_Sherlock_Light_Dialog));
xml:
<style name="AppTheme_LightDialog" parent="@android:style/Theme.Light">
<item name="android:windowFrame">@null</item>
<item name="android:windowTitleStyle">@style/DialogWindowTitle.Sherlock.Light</item>
<item name="android:windowBackground">@drawable/abs__dialog_full_holo_light</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
<item name="android:windowActionBar">false</item>
<item name="android:windowActionModeOverlay">true</item>
<item name="android:windowCloseOnTouchOutside">true</item>
<item name="android:windowNoTitle">true</item>
<item name="android:backgroundDimAmount">0.6</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:textColorPrimary">@color/abs__primary_text_holo_light</item>
<item name="android:textColorPrimaryInverse">@color/abs__primary_text_holo_dark</item>
<item name="windowMinWidthMajor">@dimen/abs__dialog_min_width_major</item>
<item name="windowMinWidthMinor">@dimen/abs__dialog_min_width_minor</item>
<item name="windowActionBar">false</item>
<item name="windowContentOverlay">@null</item>
<item name="android:textAppearance">?android:attr/textAppearanceInverse</item>
</style>
I know i can use the dialogFragment, but is there another way? the dialogs are quite simple, and as there are many of them, it would be annoying to change them all.
EDIT: I might be wrong, but it seems that using the android:alertDialogStyle attribute (shown here) changes it for old APIs , but it doesn't have a lot of customization. In fact, it supports only colors, and I'm not sure how to set even the text color (of the title and/or the message).