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
This commit is contained in:
mpodolian
2025-02-28 10:01:13 -08:00
parent c666b9587b
commit 672a32a18b
2 changed files with 5 additions and 3 deletions
@@ -117,6 +117,7 @@ public class TaskbarDragController extends DragController<BaseTaskbarContext> 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<BaseTaskbarContext> 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<BaseTaskbarContext> 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