diff options
| author | 2020-06-02 15:28:38 -0400 | |
|---|---|---|
| committer | 2020-06-02 15:28:42 -0400 | |
| commit | 8d35a119d0e55985b68a50d74e20cd95ff32807a (patch) | |
| tree | 7f854d130ded4c17049d25fcd355bf9b95f08f3e | |
| parent | 322b748b8d7c7500e0aca0f6665eb9058bc29d1f (diff) | |
Null-check the desaturating view, it might be gone.
Fixes: 155652953
Test: manual
Change-Id: Ic43cb2f8ed0cb3e3b7c32217657f068ee1ffc4ad
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java index fb081e2bf904..2ea91a7d752d 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java @@ -261,7 +261,7 @@ public class BubbleStackView extends FrameLayout private boolean mShowingDismiss = false; /** The view to desaturate/darken when magneted to the dismiss target. */ - private View mDesaturateAndDarkenTargetView; + @Nullable private View mDesaturateAndDarkenTargetView; private LayoutInflater mInflater; @@ -886,7 +886,10 @@ public class BubbleStackView extends FrameLayout // Update the paint and apply it to the bubble container. mDesaturateAndDarkenPaint.setColorFilter(new ColorMatrixColorFilter(animatedMatrix)); - mDesaturateAndDarkenTargetView.setLayerPaint(mDesaturateAndDarkenPaint); + + if (mDesaturateAndDarkenTargetView != null) { + mDesaturateAndDarkenTargetView.setLayerPaint(mDesaturateAndDarkenPaint); + } }); // If the stack itself is touched, it means none of its touchable views (bubbles, flyouts, @@ -1827,6 +1830,10 @@ public class BubbleStackView extends FrameLayout private void animateDesaturateAndDarken(View targetView, boolean desaturateAndDarken) { mDesaturateAndDarkenTargetView = targetView; + if (mDesaturateAndDarkenTargetView == null) { + return; + } + if (desaturateAndDarken) { // Use the animated paint for the bubbles. mDesaturateAndDarkenTargetView.setLayerType( @@ -1848,9 +1855,14 @@ public class BubbleStackView extends FrameLayout } private void resetDesaturationAndDarken() { + mDesaturateAndDarkenAnimator.removeAllListeners(); mDesaturateAndDarkenAnimator.cancel(); - mDesaturateAndDarkenTargetView.setLayerType(View.LAYER_TYPE_NONE, null); + + if (mDesaturateAndDarkenTargetView != null) { + mDesaturateAndDarkenTargetView.setLayerType(View.LAYER_TYPE_NONE, null); + mDesaturateAndDarkenTargetView = null; + } } /** Animates in the dismiss target. */ |