Change android: Theme.Dialog to Light AppCompat Dialog

I use .xml in my style as the main theme of the application

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

And all AlertDialogs use the same white / blue colors. But I have actions that work like Dialog parent="android:Theme.Dialog", and this box uses a dark theme . How can I change it to a theme AppCompat.Light? I tried Theme.AppCompat.Light.Dialog, but as you know, it does not work very well. Thank you

+4
source share
1 answer

You can use this theme:

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

Or that:

<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>

last time source code

+5
source

Source: https://habr.com/ru/post/1537089/


All Articles