From 132c99e4ddba00fe5217983dc237c39039dd6d1e Mon Sep 17 00:00:00 2001 From: mpodolian Date: Mon, 3 Mar 2025 17:51:19 -0800 Subject: [PATCH] Added logic to show the shell drop target and update the bubble location This change leverages a bubble bar location parameter when an app icon is dropped and displays the shell expanded view drop target when an icon is dragged over the bubble bar drop zone. Fixes: 397459664 Flag: com.android.wm.shell.enable_create_any_bubble Test: Manual. Drag a taskbar app icon to the same side as the bubble bar. Confirm that the expanded view from shell is displayed. Continue dragging to the opposite side of the bubble bar location drop zone. Confirm that the expanded view drop target is displayed on the opposite side. Release the dragged icon in the drop zone. Confirm that the bubble bar expands at the new location. Change-Id: I956d66b81810abce074b10e012cf5c873003d84c --- .../bubbles/BubbleBarViewController.java | 22 +++++++++---------- .../com/android/quickstep/SystemUiProxy.kt | 7 ++++++ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java index 1f5c5419f4..2aa5925c4f 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java @@ -126,7 +126,6 @@ public class BubbleBarViewController { }); private final BubbleBarDragListener mDragListener = new BubbleBarDragListener() { - @NonNull @Override public void getBubbleBarLocationHitRect(@NonNull BubbleBarLocation bubbleBarLocation, Rect outRect) { @@ -145,32 +144,31 @@ public class BubbleBarViewController { @Override public void onLauncherItemDroppedOverBubbleBarDragZone(@NonNull BubbleBarLocation location, @NonNull ItemInfo itemInfo) { - //TODO(b/397459664) : fix drag interruption when there are no bubbles - //TODO(b/397459664) : update bubble bar location - ShortcutInfo shortcutInfo = null; if (itemInfo instanceof WorkspaceItemInfo) { - shortcutInfo = ((WorkspaceItemInfo) itemInfo).getDeepShortcutInfo(); + ShortcutInfo shortcutInfo = ((WorkspaceItemInfo) itemInfo).getDeepShortcutInfo(); + if (shortcutInfo != null) { + mSystemUiProxy.showShortcutBubble(shortcutInfo, location); + return; + } } Intent itemIntent = itemInfo.getIntent(); - SystemUiProxy systemUiProxy = SystemUiProxy.INSTANCE.get(mActivity); - if (shortcutInfo != null) { - systemUiProxy.showShortcutBubble(shortcutInfo); - } else if (itemIntent != null && itemIntent.getComponent() != null) { - systemUiProxy.showAppBubble(itemIntent, itemInfo.user); + if (itemIntent != null && itemIntent.getComponent() != null) { + itemIntent.setPackage(itemIntent.getComponent().getPackageName()); + mSystemUiProxy.showAppBubble(itemIntent, itemInfo.user, location); } } @Override public void onLauncherItemDraggedOutsideBubbleBarDropZone() { - //TODO(b/397459664) : hide expanded view drop target onItemDraggedOutsideBubbleBarDropZone(); + mSystemUiProxy.showBubbleDropTarget(/* show = */ false); } @Override public void onLauncherItemDraggedOverBubbleBarDragZone( @NonNull BubbleBarLocation location) { - //TODO(b/397459664) : show expanded view drop target onDragItemOverBubbleBarDragZone(location); + mSystemUiProxy.showBubbleDropTarget(/* show = */ true, location); } @NonNull diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.kt b/quickstep/src/com/android/quickstep/SystemUiProxy.kt index 0f6649b81b..1de696660c 100644 --- a/quickstep/src/com/android/quickstep/SystemUiProxy.kt +++ b/quickstep/src/com/android/quickstep/SystemUiProxy.kt @@ -683,6 +683,13 @@ class SystemUiProxy @Inject constructor(@ApplicationContext private val context: fun showExpandedView() = executeWithErrorLog({ "Failed call showExpandedView" }) { bubbles?.showExpandedView() } + /** Tells SysUI to show the bubble drop target. */ + @JvmOverloads + fun showBubbleDropTarget(show: Boolean, bubbleBarLocation: BubbleBarLocation? = null) = + executeWithErrorLog({ "Failed call showDropTarget" }) { + bubbles?.showDropTarget(show, bubbleBarLocation) + } + // // Splitscreen //