I would like to change the color of the dimmed background that surrounds an Android dialog (not the Window background drawable) programmatically. I am using a dialog themed activity. I do not want to dim it, nor blur it.
If you imagine a dialog with three buttons, I would like to have it do something like this:
I'm not sure you can change the color of the background. The dimming is controlled by the dimAmount
field of the layout for the dialog window (as well as the FLAG_DIM_BEHIND
flag). dimAmount
is just a float between 0.0 and 1.0 that controls the amount of dimming (transparent to totally opaque). I think it's just an alpha blend of the existing background; there's no control of coloring as far as I've been able to find.
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