Merge "Do not update pointer postion when stack is going to collapse" into tm-qpr-dev am: 86d2469d1e

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

Change-Id: I83bbcd18ce1ab60ababbb547d8d28cdacd9b5093
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Sergey Serokurov
2022-06-15 17:08:45 +00:00
committed by Automerger Merge Worker
2 changed files with 11 additions and 4 deletions

View File

@@ -1350,14 +1350,18 @@ public class BubbleController {
mStackView.setBubbleSuppressed(update.unsuppressedBubble, false); mStackView.setBubbleSuppressed(update.unsuppressedBubble, false);
} }
boolean collapseStack = update.expandedChanged && !update.expanded;
// At this point, the correct bubbles are inflated in the stack. // At this point, the correct bubbles are inflated in the stack.
// Make sure the order in bubble data is reflected in bubble row. // Make sure the order in bubble data is reflected in bubble row.
if (update.orderChanged && mStackView != null) { if (update.orderChanged && mStackView != null) {
mDataRepository.addBubbles(mCurrentUserId, update.bubbles); 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); mStackView.setExpanded(false);
mSysuiProxy.requestNotificationShadeTopUi(false, TAG); mSysuiProxy.requestNotificationShadeTopUi(false, TAG);
} }

View File

@@ -1823,7 +1823,7 @@ 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, boolean updatePointerPositoion) {
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);
@@ -1839,7 +1839,10 @@ public class BubbleStackView extends FrameLayout
.map(b -> b.getIconView()).collect(Collectors.toList()); .map(b -> b.getIconView()).collect(Collectors.toList());
mStackAnimationController.animateReorder(bubbleViews, reorder); mStackAnimationController.animateReorder(bubbleViews, reorder);
} }
updatePointerPosition(false /* forIme */);
if (updatePointerPositoion) {
updatePointerPosition(false /* forIme */);
}
} }
/** /**