From ac0a54e91b08c6915fd213888d58b21c97c04b29 Mon Sep 17 00:00:00 2001 From: Galia Peycheva Date: Mon, 29 Mar 2021 16:45:23 +0200 Subject: [PATCH] Fix paragraphs in blur javadocs Bug: 181149137 Test: m doc-comment-check-docs Change-Id: I0f2e7cf5f1f5970060dc845b74b9c2e67d7248dd --- core/java/android/view/Window.java | 12 +++++---- core/java/android/view/WindowManager.java | 30 ++++++++++++++--------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/core/java/android/view/Window.java b/core/java/android/view/Window.java index c814e5add1b75..eaa0018fd2906 100644 --- a/core/java/android/view/Window.java +++ b/core/java/android/view/Window.java @@ -1703,29 +1703,31 @@ public abstract class Window { public abstract void setBackgroundDrawable(Drawable drawable); /** + *

* Blurs the screen behind the window within the bounds of the window. - * + *

* The density of the blur is set by the blur radius. The radius defines the size * of the neighbouring area, from which pixels will be averaged to form the final * color for each pixel. The operation approximates a Gaussian blur. * A radius of 0 means no blur. The higher the radius, the denser the blur. - * + *

* The window background drawable is drawn on top of the blurred region. The blur * region bounds and rounded corners will mimic those of the background drawable. - * + *

* For the blur region to be visible, the window has to be translucent. See * {@link android.R.styleable#Window_windowIsTranslucent}. - * + *

* Note the difference with {@link WindowManager.LayoutParams#setBlurBehindRadius}, * which blurs the whole screen behind the window. Background blur blurs the screen behind * only within the bounds of the window. - * + *

* Some devices might not support cross-window blur due to GPU limitations. It can also be * disabled at runtime, e.g. during battery saving mode, when multimedia tunneling is used or * when minimal post processing is requested. In such situations, no blur will be computed or * drawn, resulting in a transparent window background. To avoid this, the app might want to * change its theme to one that does not use blurs. To listen for cross-window blur * enabled/disabled events, use {@link WindowManager#addCrossWindowBlurEnabledListener}. + *

* * @param blurRadius The blur radius to use for window background blur in pixels * diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java index 93c3cab5b7876..4b56fd740e8da 100644 --- a/core/java/android/view/WindowManager.java +++ b/core/java/android/view/WindowManager.java @@ -818,16 +818,18 @@ public interface WindowManager extends ViewManager { } /** + *

* Returns whether cross-window blur is currently enabled. This affects both window blur behind * (see {@link LayoutParams#setBlurBehindRadius}) and window background blur (see * {@link Window#setBackgroundBlurRadius}). - * + *

* Cross-window blur might not be supported by some devices due to GPU limitations. It can also * be disabled at runtime, e.g. during battery saving mode, when multimedia tunneling is used or * when minimal post processing is requested. In such situations, no blur will be computed or * drawn, so the blur target area will not be blurred. To handle this, the app might want to * change its theme to one that does not use blurs. To listen for cross-window blur * enabled/disabled events, use {@link #addCrossWindowBlurEnabledListener}. + *

* * @see #addCrossWindowBlurEnabledListener * @see LayoutParams#setBlurBehindRadius @@ -838,21 +840,22 @@ public interface WindowManager extends ViewManager { } /** + *

* Adds a listener, which will be called when cross-window blurs are enabled/disabled at * runtime. This affects both window blur behind (see {@link LayoutParams#setBlurBehindRadius}) * and window background blur (see {@link Window#setBackgroundBlurRadius}). - * + *

* Cross-window blur might not be supported by some devices due to GPU limitations. It can also * be disabled at runtime, e.g. during battery saving mode, when multimedia tunneling is used or * when minimal post processing is requested. In such situations, no blur will be computed or * drawn, so the blur target area will not be blurred. To handle this, the app might want to * change its theme to one that does not use blurs. - * + *

* The listener will be called on the main thread. - * + *

* If the listener is added successfully, it will be called immediately with the current * cross-window blur enabled state. - * + *

* * @param listener the listener to be added. It will be called back with a boolean parameter, * which is true if cross-window blur is enabled and false if it is disabled @@ -866,18 +869,20 @@ public interface WindowManager extends ViewManager { } /** + *

* Adds a listener, which will be called when cross-window blurs are enabled/disabled at * runtime. This affects both window blur behind (see {@link LayoutParams#setBlurBehindRadius}) * and window background blur (see {@link Window#setBackgroundBlurRadius}). - * + *

* Cross-window blur might not be supported by some devices due to GPU limitations. It can also * be disabled at runtime, e.g. during battery saving mode, when multimedia tunneling is used or * when minimal post processing is requested. In such situations, no blur will be computed or * drawn, so the blur target area will not be blurred. To handle this, the app might want to * change its theme to one that does not use blurs. - * + *

* If the listener is added successfully, it will be called immediately with the current * cross-window blur enabled state. + *

* * @param executor {@link Executor} to handle the listener callback * @param listener the listener to be added. It will be called back with a boolean parameter, @@ -3627,21 +3632,22 @@ public interface WindowManager extends ViewManager { } /** + *

* Blurs the screen behind the window. The effect is similar to that of {@link #dimAmount}, * but instead of dimmed, the content behind the window will be blurred (or combined with * the dim amount, if such is specified). - * + *

* The density of the blur is set by the blur radius. The radius defines the size * of the neighbouring area, from which pixels will be averaged to form the final * color for each pixel. The operation approximates a Gaussian blur. * A radius of 0 means no blur. The higher the radius, the denser the blur. - * + *

* Note the difference with {@link android.view.Window#setBackgroundBlurRadius}, * which blurs only within the bounds of the window. Blur behind blurs the whole screen * behind the window. - * + *

* Requires {@link #FLAG_BLUR_BEHIND} to be set. - * + *

* Cross-window blur might not be supported by some devices due to GPU limitations. It can * also be disabled at runtime, e.g. during battery saving mode, when multimedia tunneling * is used or when minimal post processing is requested. In such situations, no blur will @@ -3649,7 +3655,7 @@ public interface WindowManager extends ViewManager { * and the content behind it. To avoid this, the app might want to use more * {@link #dimAmount} on its window. To listen for cross-window blur enabled/disabled * events, use {@link #addCrossWindowBlurEnabledListener}. - * + *

* @param blurBehindRadius The blur radius to use for blur behind in pixels * * @see #FLAG_BLUR_BEHIND