Handle new bubble notification while drag is in progress.

Handle new bubble notification while drag is in progress. Updated logic
to react to new bubble notifications arriving during drag operations
before a drop occurs.

Bug: 388894910
Flag: com.android.wm.shell.enable_create_any_bubble
Test: BubbleBarViewAnimatorTest
Test: Manual. Go to some application and have no bubbles. Start
dragging the taskbar icon over the bubble bar drop zone. Trigger new
bubble with the bubbles test application. Observe drop target is
hidden and new bubble is animated in, followed by flyout. When flyout
disappears, bubble bar remains on the screen. Release icon over the
bubble bar. Observe newly added application bubble is expanded. Repeat
same test, but drag the taskbar icon to the opposite side.
Test: Manual. Go to some application, but have bubbles. Start
dragging the taskbar icon over the bubble bar drop zone. Trigger new
bubble with the bubbles test application. Observe new bubble is added
and the flyout is shown. When flyout disappears, bubble bar remains on
the screen. Release icon over the bubble bar. Observe newly added
application bubble is expanded. Repeat same test, but drag the taskbar
icon to the opposite side.

Change-Id: I6fe1139ef56f4ad40d36a804016d23a9b34abf5f
This commit is contained in:
mpodolian
2025-02-13 16:56:16 -08:00
parent c7106806f1
commit 39c4bf2448
3 changed files with 94 additions and 14 deletions
@@ -276,7 +276,10 @@ public class BubbleBarViewController {
@Override
public boolean isOnLeft() {
return mBarView.getBubbleBarLocation().isOnLeft(mBarView.isLayoutRtl());
boolean shouldRevertLocation =
mBarView.isShowingDropTarget() && mIsLocationUpdatedForDropTarget;
boolean isOnLeft = mBarView.getBubbleBarLocation().isOnLeft(mBarView.isLayoutRtl());
return shouldRevertLocation != isOnLeft;
}
@Override
@@ -1053,7 +1056,12 @@ public class BubbleBarViewController {
boolean isInApp = mTaskbarStashController.isInApp();
// if this is the first bubble, animate to the initial state.
if (mBarView.getBubbleChildCount() == 1 && !isUpdate) {
mBubbleBarViewAnimator.animateToInitialState(bubble, isInApp, isExpanding);
// If a drop target is visible and the first bubble is added, hide the empty drop target
if (mBarView.isShowingDropTarget()) {
mBubbleBarPinController.hideDropTarget();
}
mBubbleBarViewAnimator.animateToInitialState(bubble, isInApp, isExpanding,
mBarView.isShowingDropTarget());
return;
}
// if we're not stashed or we're in persistent taskbar, animate for collapsed state.