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
diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java
index 1f5c541..2aa5925 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 @@
});
private final BubbleBarDragListener mDragListener = new BubbleBarDragListener() {
- @NonNull
@Override
public void getBubbleBarLocationHitRect(@NonNull BubbleBarLocation bubbleBarLocation,
Rect outRect) {
@@ -145,32 +144,31 @@
@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 0f6649b..1de6966 100644
--- a/quickstep/src/com/android/quickstep/SystemUiProxy.kt
+++ b/quickstep/src/com/android/quickstep/SystemUiProxy.kt
@@ -683,6 +683,13 @@
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
//