diff options
| author | Galia Peycheva <galinap@google.com> | 2021-02-03 15:09:54 +0100 |
|---|---|---|
| committer | Galia Peycheva <galinap@google.com> | 2021-02-03 16:25:49 +0000 |
| commit | 8e30771f55e84199106f9e9e3be10e4de343608a (patch) | |
| tree | 8712dacc24883dc2e35f9e85cab9bbf2a9d36e29 /core/java/android/view/WindowManager.java | |
| parent | e6ae6e325a5eab6ab8d7e676966d834b48f78e33 (diff) | |
Make window blur behind public API
This CL makes the blur behind functionality a public API. As part of
this change, we change its previous name (windowBackgroundBlurRadius) to
windowBlurBehindRadius. This avoids a name clash with the Window
background blur, which only blurs the area of the window. Blur behind
blurs everything behind the window (similar behaviour to the dim).
This CL exposes WM.LP.blurBehindRadius and, in addition, undeprecates an
old flag - FLAG_BLUR_BEHIND. FLAG_BLUR_BEHIND enables the blur behind
and blurBehindRadius specifies how dense the blur will be.
In addition, we expose two xml attributes on the Window -
windowBlurBehindEnable and windowBlurBehindRadius. The usage is similar
to the dim api.
Bug: 167166562
Bug: 177524486
Test: m && test app
Change-Id: If2fcde644c5bcca112495ca99ee66bae909877db
Merged-In: If2fcde644c5bcca112495ca99ee66bae909877db
Diffstat (limited to 'core/java/android/view/WindowManager.java')
| -rw-r--r-- | core/java/android/view/WindowManager.java | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java index 63f1eedf1c50..9e87c95a8a75 100644 --- a/core/java/android/view/WindowManager.java +++ b/core/java/android/view/WindowManager.java @@ -1511,9 +1511,7 @@ public interface WindowManager extends ViewManager { * Use {@link #dimAmount} to control the amount of dim. */ public static final int FLAG_DIM_BEHIND = 0x00000002; - /** Window flag: blur everything behind this window. - * @deprecated Blurring is no longer supported. */ - @Deprecated + /** Window flag: enable blur behind for this window. */ public static final int FLAG_BLUR_BEHIND = 0x00000004; /** Window flag: this window won't ever get key input focus, so the @@ -3233,11 +3231,16 @@ public interface WindowManager extends ViewManager { public boolean preferMinimalPostProcessing = false; /** - * Indicates that this window wants to have blurred content behind it. + * Specifies the amount of blur to be used to blur everything behind the window. + * The effect is similar to the dimAmount, but instead of dimming, the content behind + * will be blurred. * - * @hide + * The blur behind radius range starts at 0, which means no blur, and increases until 150 + * for the densest blur. + * + * @see #FLAG_BLUR_BEHIND */ - public int backgroundBlurRadius = 0; + public int blurBehindRadius = 0; /** * The color mode requested by this window. The target display may @@ -3626,7 +3629,7 @@ public interface WindowManager extends ViewManager { out.writeInt(mFitInsetsSides); out.writeBoolean(mFitInsetsIgnoringVisibility); out.writeBoolean(preferMinimalPostProcessing); - out.writeInt(backgroundBlurRadius); + out.writeInt(blurBehindRadius); if (providesInsetsTypes != null) { out.writeInt(providesInsetsTypes.length); out.writeIntArray(providesInsetsTypes); @@ -3695,7 +3698,7 @@ public interface WindowManager extends ViewManager { mFitInsetsSides = in.readInt(); mFitInsetsIgnoringVisibility = in.readBoolean(); preferMinimalPostProcessing = in.readBoolean(); - backgroundBlurRadius = in.readInt(); + blurBehindRadius = in.readInt(); int insetsTypesLength = in.readInt(); if (insetsTypesLength > 0) { providesInsetsTypes = new int[insetsTypesLength]; @@ -3940,8 +3943,8 @@ public interface WindowManager extends ViewManager { changes |= MINIMAL_POST_PROCESSING_PREFERENCE_CHANGED; } - if (backgroundBlurRadius != o.backgroundBlurRadius) { - backgroundBlurRadius = o.backgroundBlurRadius; + if (blurBehindRadius != o.blurBehindRadius) { + blurBehindRadius = o.blurBehindRadius; changes |= BACKGROUND_BLUR_RADIUS_CHANGED; } @@ -4108,9 +4111,9 @@ public interface WindowManager extends ViewManager { sb.append(" preferMinimalPostProcessing="); sb.append(preferMinimalPostProcessing); } - if (backgroundBlurRadius != 0) { - sb.append(" backgroundBlurRadius="); - sb.append(backgroundBlurRadius); + if (blurBehindRadius != 0) { + sb.append(" blurBehindRadius="); + sb.append(blurBehindRadius); } sb.append(System.lineSeparator()); sb.append(prefix).append(" fl=").append( |
