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

Bubble bar drop targets have been added to the TaskbarDragController
used in the TaskbarOverlayContext. This enables dragging taskbar icons
to the bubble bar drop zone from the search view on the overview screen.

Bug: 399678274
Flag: com.android.wm.shell.enable_create_any_bubble
Test: Manual. Go to the overview screen. Click the search icon. Drag any
application icon from the grid to the bubble bar drop zone. Drop the
application icon.

Change-Id: I33eb13785d8837fefc717a95a6566d3091ec855b
This commit is contained in:
mpodolian committed 2025-03-11 16:07:21 -07:00
1 parent 132c99e4dd
commit 61de3b43cb
8 files changed
+43 -17

No files matched your search

@@ -41,15 +41,16 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.android.app.animation.Interpolators;
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.R;
import com.android.launcher3.anim.AnimatedFloat;
import com.android.launcher3.anim.RoundedRectRevealOutlineProvider;
import com.android.launcher3.dragndrop.DragController;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.taskbar.TaskbarActivityContext;
import com.android.launcher3.taskbar.TaskbarControllers;
import com.android.launcher3.taskbar.TaskbarDragController;
import com.android.launcher3.taskbar.TaskbarInsetsController;
import com.android.launcher3.taskbar.TaskbarSharedState;
import com.android.launcher3.taskbar.TaskbarStashController;
@@ -144,6 +145,7 @@ public class BubbleBarViewController {
@Override
public void onLauncherItemDroppedOverBubbleBarDragZone(@NonNull BubbleBarLocation location,
@NonNull ItemInfo itemInfo) {
AbstractFloatingView.closeAllOpenViews(mActivity);
if (itemInfo instanceof WorkspaceItemInfo) {
ShortcutInfo shortcutInfo = ((WorkspaceItemInfo) itemInfo).getDeepShortcutInfo();
if (shortcutInfo != null) {
@@ -199,7 +201,6 @@ public class BubbleBarViewController {
private BubbleBarFlyoutController mBubbleBarFlyoutController;
private BubbleBarPinController mBubbleBarPinController;
private TaskbarSharedState mTaskbarSharedState;
private TaskbarDragController mTaskbarDragController;
private final BubbleBarLocationDropTarget mBubbleBarLeftDropTarget;
private final BubbleBarLocationDropTarget mBubbleBarRightDropTarget;
private final TimeSource mTimeSource = System::currentTimeMillis;
@@ -236,7 +237,6 @@ public class BubbleBarViewController {
/** Initializes controller. */
public void init(TaskbarControllers controllers, BubbleControllers bubbleControllers,
TaskbarViewPropertiesProvider taskbarViewPropertiesProvider) {
mTaskbarDragController = controllers.taskbarDragController;
mTaskbarSharedState = controllers.getSharedState();
mBubbleStashController = bubbleControllers.bubbleStashController;
mBubbleBarController = bubbleControllers.bubbleBarController;
@@ -338,8 +338,18 @@ public class BubbleBarViewController {
mBubbleBarController.updateBubbleBarLocation(location, source);
}
};
mTaskbarDragController.addDropTarget(mBubbleBarLeftDropTarget);
mTaskbarDragController.addDropTarget(mBubbleBarRightDropTarget);
}
/** Adds bubble bar locations drop zones to the drag controller. */
public void addBubbleBarDropTargets(DragController<?> dragController) {
dragController.addDropTarget(mBubbleBarLeftDropTarget);
dragController.addDropTarget(mBubbleBarRightDropTarget);
}
/** Removes bubble bar locations drop zones to the drag controller. */
public void removeBubbleBarDropTargets(DragController<?> dragController) {
dragController.removeDropTarget(mBubbleBarLeftDropTarget);
dragController.removeDropTarget(mBubbleBarRightDropTarget);
}
/** Returns animated float property responsible for pinning transition animation. */
@@ -1356,8 +1366,6 @@ public class BubbleBarViewController {
/** Called when the controller is destroyed. */
public void onDestroy() {
adjustTaskbarAndHotseatToBubbleBarState(/*isBubbleBarExpanded = */false);
mTaskbarDragController.removeDropTarget(mBubbleBarLeftDropTarget);
mTaskbarDragController.removeDropTarget(mBubbleBarRightDropTarget);
}
/**