From 672a32a18b0a67879aeca9b9e6cac68fde8d8122 Mon Sep 17 00:00:00 2001 From: mpodolian Date: Fri, 28 Feb 2025 10:01:13 -0800 Subject: [PATCH] Removed fly-back animation after a taskbar item drop on the bubble bar Added logic to track whether the drop target handled the app icon drop, in order to prevent the fly-back animation in those cases. Bug: 397459664 Flag: com.android.wm.shell.enable_create_any_bubble Test: Manual. Drop a taskbar icon onto the bubble bar. Observe that no fly-back animation is performed for the dropped icon. Change-Id: If439d7280fe9f713c181531ac899ac8ad37ed481 --- .../android/launcher3/taskbar/TaskbarDragController.java | 6 ++++-- .../launcher3/taskbar/bubbles/BubbleBarViewController.java | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java index 9b7e320892..1b516bef4d 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java @@ -117,6 +117,7 @@ public class TaskbarDragController extends DragController im private int mRegistrationY; private boolean mIsSystemDragInProgress; + private boolean mIsDropHandledByDropTarget; // Animation for the drag shadow back into position after an unsuccessful drag private ValueAnimator mReturnAnimator; @@ -253,7 +254,8 @@ public class TaskbarDragController extends DragController im /* originalView = */ btv, dragLayerX + dragOffset.x, dragLayerY + dragOffset.y, - (View target, DropTarget.DragObject d, boolean success) -> {} /* DragSource */, + (View target, DropTarget.DragObject d, boolean success) -> + mIsDropHandledByDropTarget = success /* DragSource */, btv.getTag() instanceof ItemInfo itemInfo ? itemInfo : null, dragRect, scale * iconScale, @@ -562,7 +564,7 @@ public class TaskbarDragController extends DragController im @Override protected void endDrag() { - if (mDisallowGlobalDrag) { + if (mDisallowGlobalDrag && !mIsDropHandledByDropTarget) { // We need to explicitly set deferDragViewCleanupPostAnimation to true here so the // super call doesn't remove it from the drag layer before the animation completes. // This variable gets set in to false in super.dispatchDropComplete() because it diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java index beda30c3b3..1f5c5419f4 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java @@ -145,7 +145,7 @@ public class BubbleBarViewController { @Override public void onLauncherItemDroppedOverBubbleBarDragZone(@NonNull BubbleBarLocation location, @NonNull ItemInfo itemInfo) { - //TODO(b/397459664) : fix task bar icon animation after drop + //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) {