Merge "Drag and drop from the search view on the overview screen." into main

This commit is contained in:
Treehugger Robot
2025-03-11 18:26:48 -07:00
committed by Android (Google) Code Review
8 changed files with 43 additions and 17 deletions
@@ -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);
}
/**