Merge "Reorder bubbles without animations on collapse" into sc-dev am: 26e6b76d99

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13665681

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I754e00b34a283251d8a500429d1b672560af3f09
This commit is contained in:
Lyn Han
2021-02-24 18:57:40 +00:00
committed by Automerger Merge Worker

View File

@@ -1539,19 +1539,16 @@ public class BubbleStackView extends FrameLayout
* Update bubble order and pointer position. * Update bubble order and pointer position.
*/ */
public void updateBubbleOrder(List<Bubble> bubbles) { public void updateBubbleOrder(List<Bubble> bubbles) {
if (isExpansionAnimating()) {
return;
}
final Runnable reorder = () -> { final Runnable reorder = () -> {
for (int i = 0; i < bubbles.size(); i++) { for (int i = 0; i < bubbles.size(); i++) {
Bubble bubble = bubbles.get(i); Bubble bubble = bubbles.get(i);
mBubbleContainer.reorderView(bubble.getIconView(), i); mBubbleContainer.reorderView(bubble.getIconView(), i);
} }
}; };
if (mIsExpanded) { if (mIsExpanded || isExpansionAnimating()) {
reorder.run(); reorder.run();
updateBadgesAndZOrder(false /* setBadgeForCollapsedStack */); updateBadgesAndZOrder(false /* setBadgeForCollapsedStack */);
} else { } else if (!isExpansionAnimating()) {
List<View> bubbleViews = bubbles.stream() List<View> bubbleViews = bubbles.stream()
.map(b -> b.getIconView()).collect(Collectors.toList()); .map(b -> b.getIconView()).collect(Collectors.toList());
mStackAnimationController.animateReorder(bubbleViews, reorder); mStackAnimationController.animateReorder(bubbleViews, reorder);