Do not update pointer postion when stack is going to collapse

Bug: 232293580
Test: atest SystemUITests
Test: video at https://drive.google.com/file/d/1Yjs7AzTeI_Zp764CPF9d6e7zI-XRvYX4/view?usp=sharing
Change-Id: I3131a8f32e088573e8e4e8401b6cc279e73bef87
This commit is contained in:
Sergey Serokurov
2022-06-10 17:30:51 -07:00
parent 2456f4957d
commit bccc4c2cac
2 changed files with 11 additions and 4 deletions

View File

@@ -1350,14 +1350,18 @@ public class BubbleController {
mStackView.setBubbleSuppressed(update.unsuppressedBubble, false);
}
boolean collapseStack = update.expandedChanged && !update.expanded;
// At this point, the correct bubbles are inflated in the stack.
// Make sure the order in bubble data is reflected in bubble row.
if (update.orderChanged && mStackView != null) {
mDataRepository.addBubbles(mCurrentUserId, update.bubbles);
mStackView.updateBubbleOrder(update.bubbles);
// if the stack is going to be collapsed, do not update pointer position
// after reordering
mStackView.updateBubbleOrder(update.bubbles, !collapseStack);
}
if (update.expandedChanged && !update.expanded) {
if (collapseStack) {
mStackView.setExpanded(false);
mSysuiProxy.requestNotificationShadeTopUi(false, TAG);
}

View File

@@ -1796,7 +1796,7 @@ public class BubbleStackView extends FrameLayout
/**
* Update bubble order and pointer position.
*/
public void updateBubbleOrder(List<Bubble> bubbles) {
public void updateBubbleOrder(List<Bubble> bubbles, boolean updatePointerPositoion) {
final Runnable reorder = () -> {
for (int i = 0; i < bubbles.size(); i++) {
Bubble bubble = bubbles.get(i);
@@ -1812,7 +1812,10 @@ public class BubbleStackView extends FrameLayout
.map(b -> b.getIconView()).collect(Collectors.toList());
mStackAnimationController.animateReorder(bubbleViews, reorder);
}
updatePointerPosition(false /* forIme */);
if (updatePointerPositoion) {
updatePointerPosition(false /* forIme */);
}
}
/**