I recently migrated my app to Material Design and I stumbled upon this problem with my Alert Dialogs:
I'm applying the dialog style like this:
<item name="android:alertDialogTheme">@style/Theme.AlertDialog</item>
and Theme.AlertDialog looks like this:
<style name="Theme.AlertDialog" parent="Base.V14.Theme.AppCompat.Dialog">
<item name="colorPrimary">@color/theme_primary</item>
<item name="colorPrimaryDark">@color/theme_primary_dark</item>
<item name="colorAccent">@color/theme_accent_dark</item>
</style>
This is happening on my Kitkat device and it works fine on Lollipop. Can you help me with getting rid of that outer background?
The point is here:
<style name="Theme.AlertDialog" parent="Base.V14.Theme.AppCompat.Dialog">
...
<item name="colorPrimary">@color/theme_primary</item>
<item name="colorPrimaryDark">@color/theme_primary_dark</item>
<item name="colorAccent">@color/theme_accent_dark</item>
...
<item name="android:windowBackground">@android:color/transparent</item>
...
</style>
As ironman told me here, be sure that you import the right class.
Right : import android.support.v7.app.AlertDialog;
Wrong : import android.app.AlertDialog;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With