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 //