0

I want to change the black transparent background to white transparent, tried to change it in the AppTheme style but it didn't work.

https://i.stack.imgur.com/aYjBc.png

Also I want to change the black blur background to white blur, tried to change it in the AppTheme style.

I also tried renderscript, fastblur, xml mentioned in this, but it changed only the dialog white background

enter image description here

Any ideas how to change it? Thanks in advance!

Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
Thwe
  • 83
  • 1
  • 2
  • 8
  • Can you show how you tried to change it in the theme XML? Are you using AppCompat or Material Components? – Tenfour04 Mar 31 '21 at 18:34

1 Answers1

3

Using the style you can change the dim not the blur.
You can use the android:backgroundDimAmount attribute (range: 1.0 - 0.0):

<style name="ThemeOverlay.App.MaterialAlertDialog" parent="ThemeOverlay.MaterialComponents.MaterialAlertDialog">
    <item name="android:backgroundDimAmount">0.xx</item>
</style>

and

MaterialAlertDialogBuilder(context, R.style.ThemeOverlay_App_MaterialAlertDialog)
    .setTitle("Title")
    .show()

With 0.10 and 0.90

enter image description here enter image description here

Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
  • 1
    your solution for changing background color is work like a charm. I also wanted a blur affect. I've edited the image in my question. Do you know how can I achieve it? Thank you! – Thwe Apr 01 '21 at 03:29