From 95089b6d65be8911fd699616aec4fd84c6071176 Mon Sep 17 00:00:00 2001 From: Lyn Han Date: Mon, 22 Feb 2021 17:34:57 -0600 Subject: [PATCH] Reorder bubbles without animations on collapse Fixes: 180045233 Test: select different bubble while expanded, collapse stack => see that newly selected bubble is on top of stack => no weird animations like in b/178499353 Change-Id: I6d95763a4dd08fd8d1e30dd93131ff27b4fd7c2c --- .../src/com/android/wm/shell/bubbles/BubbleStackView.java | 7 ++----- 1 file changed, 2 insertions(+), 5 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 a3edc20e242a2..a8ab4064455cc 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 @@ -1539,19 +1539,16 @@ public class BubbleStackView extends FrameLayout * Update bubble order and pointer position. */ public void updateBubbleOrder(List bubbles) { - if (isExpansionAnimating()) { - return; - } final Runnable reorder = () -> { for (int i = 0; i < bubbles.size(); i++) { Bubble bubble = bubbles.get(i); mBubbleContainer.reorderView(bubble.getIconView(), i); } }; - if (mIsExpanded) { + if (mIsExpanded || isExpansionAnimating()) { reorder.run(); updateBadgesAndZOrder(false /* setBadgeForCollapsedStack */); - } else { + } else if (!isExpansionAnimating()) { List bubbleViews = bubbles.stream() .map(b -> b.getIconView()).collect(Collectors.toList()); mStackAnimationController.animateReorder(bubbleViews, reorder);