Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change android:Theme.Dialog to Light AppCompat Dialog

Tags:

java

android

xml

I'm using in my style.xml as main app theme

  <style name="AppTheme" parent="Theme.AppCompat.Light">

And all AlertDialogs using same white/blue colors. But i have Activities which working as Dialog parent="android:Theme.Dialog" and this box use dark theme. How could I change it to AppCompat.Light theme? I tryed Theme.AppCompat.Light.Dialog but as you know it doesn't working well. Thanks.

like image 813
PePe Avatar asked Apr 18 '14 12:04

PePe


1 Answers

You can use this theme:

 <style name="AppTheme" parent="android:Theme.DeviceDefault.Light.Dialog">

Or this:

<style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light">
    <!-- API 14 theme customizations can go here. -->
</style>

 <style name="MyAppCompatDialogTheme" parent="AppBaseTheme">
    <item name="android:windowIsFloating">false</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:windowSoftInputMode">stateAlwaysHidden</item>
    <item name="android:windowActionModeOverlay">true</item>
    <item name="android:windowIsTranslucent">true</item>
</style>

source last code

like image 88
Cícero Moura Avatar answered Nov 16 '22 00:11

Cícero Moura