How to define the screen hue/color after AlertDialog shown?

Viewed 54

When AlertDialog is being shown, the whole screen hue/color changes. Is it somehow possible to define to which color should it be changed? Below are screens - before and after AlertDialog appears.

Before:

sreen before AlertDialog appears

After:

screen after AlertDialog appears

You can see that the screen color changed.

What I noticed it looks like it is not the color change, but just all colors are becoming darker. Can I somehow define how this change should work like?

1 Answers

It could be because FLAG_DIM_BEHIND is set on your dialog window.

In that case you can remove it with the clear flags method: dialogWindow.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)

One quick way to check which flags are set on your window is to check the mAttrs-field on your window in adb shell dumpsys window windows.

Related