summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Liran Binyamin <liranb@google.com> 2024-03-05 12:16:07 -0500
committer Liran Binyamin <liranb@google.com> 2024-03-05 12:16:07 -0500
commit1487b7cb2c86271ff2d190ab69e7907232981284 (patch)
tree7d73394564c042b009dd5ddcd45222a5e71ef1d0
parent67bf528527b5e27d4eeaed0c4c9e11f433c68acd (diff)
Fix bubble reordering issue
This change ensures that the deferred reordering action always runs at the end of the gesture. We started deferring reordering actions to avoid breaking drag gestures. But tapping on the selected bubble to collapse the stack is considered a gesture as well. Previously the reorder action did not get run in that case, because the specific touch listener that runs it ignores touch events during animations. Fixes: 323310200 Test: Manual - Create 2 bubbles - Expand stack - Tap on second bubble - Tap on the second bubble again to collapse the stack - Observe that the second bubble is showing in the collapsed state Test: Manual -- also checked that dragging isn't broken when a new bubble is added Change-Id: I4bfcff7e23e7ee3f4304a28cac4a9ba6e10cee16
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java11
1 files changed, 6 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 8fd6ffe15cfe..474430eb44ab 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
@@ -717,11 +717,6 @@ public class BubbleStackView extends FrameLayout
// Hide the stack after a delay, if needed.
updateTemporarilyInvisibleAnimation(false /* hideImmediately */);
-
- if (mShouldReorderBubblesAfterGestureCompletes) {
- mShouldReorderBubblesAfterGestureCompletes = false;
- updateBubbleOrderInternal(mBubbleData.getBubbles(), true);
- }
}
};
@@ -2732,6 +2727,12 @@ public class BubbleStackView extends FrameLayout
ev.getAction() != MotionEvent.ACTION_UP
&& ev.getAction() != MotionEvent.ACTION_CANCEL;
+ // If there is a deferred reorder action, and the gesture is over, run it now.
+ if (mShouldReorderBubblesAfterGestureCompletes && !mIsGestureInProgress) {
+ mShouldReorderBubblesAfterGestureCompletes = false;
+ updateBubbleOrderInternal(mBubbleData.getBubbles(), false);
+ }
+
return dispatched;
}