From bd85671adbe3fb2aa6c30a1ead0614c58242eff8 Mon Sep 17 00:00:00 2001 From: Miranda Kephart Date: Wed, 23 Feb 2022 09:04:10 -0500 Subject: Fix screenshot not showing up on subsequent screenshots The static screenshot view wasn't getting set back to alpha=1 on reset, so it was effectively invisible. This change resets it and returns to animating out the background protection. Bug: 219790596 Fix: 219790596 Test: manual; observed taking screenshots in quick succession (while the screenshot was animating out) to see that the alpha wasn't reset, and was after the change Change-Id: I3afc4e97fd1cd28a1cf9988be0c519590dca7b30 (cherry picked from commit 163d76a7eaa141c2468e32c604a92ea69da75c14) --- .../src/com/android/systemui/screenshot/ScreenshotView.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java index 1241e1de0ca4..6d729b92e7b8 100644 --- a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java +++ b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java @@ -403,12 +403,20 @@ public class ScreenshotView extends FrameLayout implements } @Override - public void onSwipeDismissInitiated(Animator animator) { + public void onSwipeDismissInitiated(Animator anim) { if (DEBUG_DISMISS) { Log.d(ScreenshotView.TAG, "dismiss triggered via swipe gesture"); } mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_SWIPE_DISMISSED, 0, mPackageName); + anim.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationStart(Animator animation) { + super.onAnimationStart(animation); + mBackgroundProtection.animate() + .alpha(0).setDuration(anim.getDuration()).start(); + } + }); } @Override @@ -999,6 +1007,7 @@ public class ScreenshotView extends FrameLayout implements mSmartChips.clear(); mQuickShareChip = null; setAlpha(1); + mScreenshotStatic.setAlpha(1); mScreenshotSelectorView.stop(); } -- cgit v1.2.3-59-g8ed1b