From 49bb2106a7dd5f8008b522d0d589633935db41f9 Mon Sep 17 00:00:00 2001 From: Liran Binyamin Date: Fri, 2 Feb 2024 20:40:46 -0500 Subject: Fix bubble manage menu after dismissing bubble After dragging to dismiss a bubble and tapping on the manage button, the manage menu is now displayed correctly on top of the expanded view. Previously, the expanded view is marked temporarily hidden when the drag motion starts. The surface z ordering is reset at the start of the expanded view animation, and then set again when it ends. However, because the expanded view is temporarily hidden, the z ordering doesn't get set at the end. This change sets it when the bubble switch animation ends right after the expanded view is no longer temporarily hidden. Flag: NA Fixes: 280355857 Test: Manual - Add 2 bubbles - Expand bubble stack - Drag the selected bubble to dismiss - The second bubble should be selected - Tap on the manage button - Observe that the manage menu is drawn on top of the expanded view Change-Id: I4410c591e88881d9e434dbdb7f7d2e250c0f718b --- .../src/com/android/wm/shell/bubbles/BubbleStackView.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'libs') diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java index 9facef36a74e..0b4034deed23 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java @@ -2612,6 +2612,18 @@ public class BubbleStackView extends FrameLayout mExpandedViewTemporarilyHidden = false; mIsBubbleSwitchAnimating = false; mExpandedViewContainer.setAnimationMatrix(null); + + // When a bubble is being dragged, the expanded view is temporarily hidden. + // If the motion ends with dismissing the bubble, with multiple bubbles in + // the stack, we'll end up here to switch to the new bubble. However, the + // expanded view animation might not actually set the z ordering for the + // expanded view correctly, because the view may still be temporarily + // hidden. So set it again here. + BubbleExpandedView bev = mExpandedBubble.getExpandedView(); + if (bev != null) { + mExpandedBubble.getExpandedView().setSurfaceZOrderedOnTop(false); + mExpandedBubble.getExpandedView().setAnimating(false); + } }) .start(); }, 25); @@ -2691,7 +2703,7 @@ public class BubbleStackView extends FrameLayout if (!mExpandedBubble.getExpandedView().isUsingMaxHeight()) { mExpandedViewContainer.animate().translationY(newExpandedViewTop); } - List animList = new ArrayList(); + List animList = new ArrayList<>(); for (int i = 0; i < mBubbleContainer.getChildCount(); i++) { View child = mBubbleContainer.getChildAt(i); float transY = mPositioner.getExpandedBubbleXY(i, getState()).y; -- cgit v1.2.3-59-g8ed1b