I can see that when I use the same flag as shown on the API-demos for blurring the background, I get a warning that it's deprecated:
"The field WindowManager.LayoutParams.FLAG_BLUR_BEHIND is deprecated".
I've read about it, and I've found that "Blurring is no longer supported".
Does it mean that it won't work on future versions? Why did they deprecate it? Is there an alternative? I really like this feature.
I want to give alternative to "FLAG_BLUR_BEHIND"
see this: Android 12 Window Blurs
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
val window: Window = this.window
window.setBackgroundBlurRadius(20) // Set blur radius
}
For earlier version (use this) :
window.setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND, WindowManager.LayoutParams.FLAG_BLUR_BEHIND); // important
window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION); //optional for setting the transparent navigation
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE; // optional