From 9d460d8fe1f4eb0d0d71414500a3cc9014f14ecc Mon Sep 17 00:00:00 2001 From: Mateusz Cicheński Date: Tue, 16 Aug 2022 16:34:16 +0000 Subject: Always invoke show on the dismiss target for pip. Previously, if the user moved pip, and then started moving it again before the dismiss target hide animation finished, the dismiss target would not show up again, since it was still VISIBLE. Test: manually, open pip and move it around, dismiss target always shows up Bug: 242616699 Change-Id: Iac288f5855f0d26075113e795dd2b88b6a152275 --- .../src/com/android/wm/shell/pip/phone/PipDismissTargetHandler.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipDismissTargetHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipDismissTargetHandler.java index a0e22011b5d0..7619646804ad 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipDismissTargetHandler.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipDismissTargetHandler.java @@ -288,8 +288,10 @@ public class PipDismissTargetHandler implements ViewTreeObserver.OnPreDrawListen if (mTargetViewContainer.getVisibility() != View.VISIBLE) { mTargetViewContainer.getViewTreeObserver().addOnPreDrawListener(this); - mTargetViewContainer.show(); } + // always invoke show, since the target might still be VISIBLE while playing hide animation, + // so we want to ensure it will show back again + mTargetViewContainer.show(); } /** Animates the magnetic dismiss target out and then sets it to GONE. */ -- cgit v1.2.3-59-g8ed1b