I need a dialog with custom background color and rounded corners. How can I keep default layout params using custom window background for AlertDialog?
Currently, my dialog has smaller left-right margin than in regular dialog. Also, dialog buttons such as positive and neutral have more shift from the edge of dialog.
<style name="DialogStuffTheme" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="android:windowBackground">@drawable/bg_custom</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
<item name="android:gravity">center</item>
</style>
bg_custom.xml:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<gradient
android:angle="270"
android:startColor="@color/Cyan200"
android:endColor="@color/Green200"
android:type="linear" />
<corners
android:radius="@dimen/dialog_corner_radius" />
</shape>
</item>
</selector>