diff options
| author | 2023-10-31 15:37:15 -0400 | |
|---|---|---|
| committer | 2023-10-31 15:44:27 -0400 | |
| commit | 74d9a0b96af01a00add7b7cf6b466b8b4960f51b (patch) | |
| tree | cfe940e6032ea34ed6de349bb449f887e578e808 | |
| parent | 9e0426dfaa6fba8e784c98c78577046c9b3a8cf6 (diff) | |
Reset the expanded bubble after dismissing the stack
This fixes the behavior where the stack stays expanded after swiping home after restoring the last bubble.
The problem here is that when the stack is dismissed, mExpandedBubble still points to the last selected bubble.
When the stack is restored, with the same bubble, the stack thinks that the expanded bubble didn't change, and does not update the animation controller correctly.
The controller still points to an old expanded view, which prevents the collapsing animation from running.
Fixes: 289988596
Flag: NONE
Test: Manual
- Create bubble
- Dismiss the stack
- Create the same bubble and expand it
- Swipe home
- Observe that the stack collapses correctly
Change-Id: Ib5a51b67f319bd32b69faf7006bd31a34d8bdcbf
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java | 18 |
1 files changed, 10 insertions, 8 deletions
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 3660fa29e9e4..45389d577e1b 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 @@ -1828,9 +1828,12 @@ public class BubbleStackView extends FrameLayout } bubble.cleanupViews(); // cleans up the icon view updateExpandedView(); // resets state for no expanded bubble + mExpandedBubble = null; }); logBubbleEvent(bubble, FrameworkStatsLog.BUBBLE_UICHANGED__ACTION__DISMISSED); return; + } else if (getBubbleCount() == 1) { + mExpandedBubble = null; } // Remove it from the views for (int i = 0; i < getBubbleCount(); i++) { @@ -2419,14 +2422,13 @@ public class BubbleStackView extends FrameLayout mExpandedAnimationController.notifyPreparingToCollapse(); updateOverflowDotVisibility(false /* expanding */); - final Runnable collapseBackToStack = () -> mExpandedAnimationController.collapseBackToStack( - mStackAnimationController - .getStackPositionAlongNearestHorizontalEdge() - /* collapseTo */, - () -> { - mBubbleContainer.setActiveController(mStackAnimationController); - updateOverflowVisibility(); - }); + final Runnable collapseBackToStack = () -> + mExpandedAnimationController.collapseBackToStack( + mStackAnimationController.getStackPositionAlongNearestHorizontalEdge(), + () -> { + mBubbleContainer.setActiveController(mStackAnimationController); + updateOverflowVisibility(); + }); final Runnable after = () -> { final BubbleViewProvider previouslySelected = mExpandedBubble; |