3

Possible Duplicate:
Light theme for AlertDialog?

I haven't been able to find a Light Theme provided by the sdk for dialogs. Setting a Dialog's style Theme.Light, makes it appear to be a full screen Activity -- and there doesn't appear to be any Theme.LightDialog available.

It was recommended to me that I create my own LightDialog Theme. In order to do this I tried: 1. extending android's Theme.Light and adding the dialogy properties from Theme.Dialog

<style name="Theme.LightDialog" parent="@android:style/Theme.Light">
  <item name="android:windowFrame">@null</item> 
  <item name="android:windowTitleStyle">@android:style/DialogWindowTitle</item> 
  <item name="android:windowBackground">@android:drawable/panel_background</item> 
  <item name="android:windowIsFloating">true</item> 
  <item name="android:windowContentOverlay">@null</item> 
  <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item> 
</style>

... and 2. extending android's Theme.Dialog and adding the lighty properties from Theme.Light.

   <style name="Theme.LightDialog" parent="@android:style/Theme.Dialog">
          <item name="android:windowBackground">@drawable/screen_background_light</item> 
          <item name="android:colorBackground">@android:color/background_light</item> 
          <item name="android:colorForeground">@androidcolor/bright_foreground_light</item> 
          <item name="android:colorForegroundInverse">@android:color/bright_foreground_light_inverse</item> 
          <item name="android:textColorPrimary">@android:color/primary_text_light</item> 
          <item name="android:textColorSecondary">@android:color/secondary_text_light</item> 
          <item name="android:textColorTertiary">@android:color/tertiary_text_light</item> 
          <item name="android:textColorPrimaryInverse">@android:color/primary_text_dark</item> 
          <item name="android:textColorSecondaryInverse">@android:color/secondary_text_dark</item> 
          <item name="android:textColorTertiaryInverse">@android:color/tertiary_text_dark</item> 
          <item name="android:textColorPrimaryDisableOnly">@android:color/primary_text_light_disable_only</item> 
          <item name="android:textColorPrimaryInverseDisableOnly">@android:color/primary_text_dark_disable_only</item> 
          <item name="android:textColorPrimaryNoDisable">@android:color/primary_text_light_nodisable</item> 
          <item name="android:textColorSecondaryNoDisable">@android:color/secondary_text_light_nodisable</item> 
          <item name="android:textColorPrimaryInverseNoDisable">@android:color/primary_text_dark_nodisable</item> 
          <item name="android:textColorSecondaryInverseNoDisable">@android:color/secondary_text_dark_nodisable</item> 
          <item name="android:textColorHint">@android:color/hint_foreground_light</item> 
          <item name="android:textColorHintInverse">@android:color/hint_foreground_dark</item> 
    </style> 

Both of these attempts failed because they use non-public attributes. Any suggestions on how to create a LightDialog theme?

Community
  • 1
  • 1
ab11
  • 19,770
  • 42
  • 120
  • 207
  • Any news? I'm stuck on this as well. – AlikElzin-kilaka Jun 03 '12 at 10:34
  • This helps but it kind of tells you to go paint the stuff yourself: http://stackoverflow.com/questions/2017777/change-color-of-window-frame – AlikElzin-kilaka Jun 03 '12 at 11:46
  • Sorry, I didn't really think my answer through properly before posting. Perhaps these similar questions will help you: http://stackoverflow.com/questions/2422562/how-to-change-theme-for-alertdialog http://stackoverflow.com/questions/3507016/light-theme-for-alertdialog – howettl Oct 06 '11 at 16:43
  • Well, I am actually using a Dialog -- not an activity. – ab11 Oct 06 '11 at 16:50

0 Answers0