Drag and drop from the search view on the overview screen.

When the bubble bar is stashed and an icon is dragged from the search
grid towards it, the bubble bar should be un-stashed. Conversely, if the
icon is dragged to the opposite location of the stashed bubble bar, the
handle should teleport out, and the collapsed bubble bar should
teleport in.
This change implements logic that addresses this behavior.

Bug: 399678274
Test: Manual. Drag and drop application icons from the search grid to
the bubble bar drop areas.
Flag: com.android.wm.shell.enable_create_any_bubble

Change-Id: Ief9ef3e5c24f8199b2812fd0adf63ae3f6cf8f32
This commit is contained in:
Mykola Podolian committed 2025-03-20 09:39:35 -07:00
1 parent 3a4595c207
commit 6ddfa5dfd5
7 files changed
+255 -78

No files matched your search

@@ -510,6 +510,8 @@ public class TaskbarDragController extends DragController<BaseTaskbarContext> im
} else {
// This will take care of calling maybeOnDragEnd() after the animation
animateGlobalDragViewToOriginalPosition(btv, dragEvent);
//TODO(b/399678274): hide drop target in shell
notifyBubbleBarItemDragCanceled();
}
mActivity.getDragLayer().setOnDragListener(null);
@@ -536,10 +538,10 @@ public class TaskbarDragController extends DragController<BaseTaskbarContext> im
mControllers.taskbarAutohideSuspendController.updateFlag(
TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_DRAGGING, false);
mActivity.onDragEnd();
// If an item is dropped on the bubble bar, the bubble bar handles the drop,
// so it should not collapse along with the taskbar.
boolean droppedOnBubbleBar = notifyBubbleBarItemDropped();
if (mReturnAnimator == null) {
// If an item is dropped on the bubble bar, the bubble bar handles the drop,
// so it should not collapse along with the taskbar.
boolean droppedOnBubbleBar = notifyBubbleBarItemDropped();
// Upon successful drag, immediately stash taskbar.
// Note, this must be done last to ensure no AutohideSuspendFlags are active, as
// that will prevent us from stashing until the timeout.
@@ -563,12 +565,17 @@ public class TaskbarDragController extends DragController<BaseTaskbarContext> im
BubbleBarViewController bubbleBarViewController = bc.bubbleBarViewController;
boolean showingDropTarget = bubbleBarViewController.isShowingDropTarget();
if (showingDropTarget) {
bubbleBarViewController.onItemDroppedInBubbleBarDragZone();
bubbleBarViewController.onItemDragCompleted();
}
return showingDropTarget;
}).orElse(false);
}
private void notifyBubbleBarItemDragCanceled() {
mControllers.bubbleControllers.ifPresent(bc ->
bc.bubbleBarViewController.onItemDraggedOutsideBubbleBarDropZone());
}
@Override
protected void endDrag() {
if (mDisallowGlobalDrag && !mIsDropHandledByDropTarget) {