From 931021258274ca8f444cf49ab59ba9ce06267efe Mon Sep 17 00:00:00 2001 From: mpodolian Date: Thu, 29 May 2025 11:18:55 -0700 Subject: [PATCH] Notify Taskbar and Navigation bar of the bubble bar location updates. Added logic to notify the BubbleBarLocationListeners (Taskbar and Navigation bar) of bubble bar location animated. Fixes: 420929193 Test: Manual. Use unfolded foldable device. Set 3 buttons navigation mode. Go to the launcher overview screen. Create any application bubble. Drag bubble to the opposite side of the screen - observe navigation buttons bar updates its location with the bubble bar. Add one more application bubble. Drag bubble from the expanded bubble bar. Observe navigation bar position is updated with the bubble bar. Flag: EXEMPT - bugfix Change-Id: I2bbdcdd702141b19695480e87d6cdd456e834e11 --- .../launcher3/taskbar/bubbles/BubbleControllers.java | 2 +- .../taskbar/bubbles/BubbleDragController.java | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleControllers.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleControllers.java index 0a68478fc0..b7df9a6f33 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleControllers.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleControllers.java @@ -118,7 +118,7 @@ public class BubbleControllers { .get(ALPHA_INDEX_BUBBLE_BAR); } }); - bubbleDragController.init(/* bubbleControllers = */ this); + bubbleDragController.init(/* bubbleControllers = */ this, bubbleBarLocationListeners); bubbleDismissController.init(/* bubbleControllers = */ this); bubbleBarPinController.init(this, bubbleBarLocationListeners); bubblePinController.init(this); diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleDragController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleDragController.java index 41686deeee..7535d366cc 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleDragController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleDragController.java @@ -30,6 +30,7 @@ import androidx.annotation.Nullable; import androidx.dynamicanimation.animation.FloatPropertyCompat; import com.android.launcher3.taskbar.TaskbarActivityContext; +import com.android.launcher3.taskbar.bubbles.BubbleBarController.BubbleBarLocationListener; import com.android.wm.shell.shared.bubbles.BaseBubblePinController.LocationChangeListener; import com.android.wm.shell.shared.bubbles.BubbleAnythingFlagHelper; import com.android.wm.shell.shared.bubbles.BubbleBarLocation; @@ -89,6 +90,7 @@ public class BubbleDragController { private BubbleDismissController mBubbleDismissController; private BubbleBarPinController mBubbleBarPinController; private BubblePinController mBubblePinController; + private BubbleBarLocationListener mBubbleBarLocationListener; private final DropTargetManager mDropTargetManager; private final DragZoneFactory mDragZoneFactory; private final BubbleDragZoneChangedListener mBubbleDragZoneChangedListener; @@ -143,12 +145,14 @@ public class BubbleDragController { * Should be careful to only access things that were created in constructors for now, as some * controllers may still be waiting for init(). */ - public void init(@NonNull BubbleControllers bubbleControllers) { + public void init(@NonNull BubbleControllers bubbleControllers, + BubbleBarLocationListener bubbleBarLocationListener) { mBubbleBarController = bubbleControllers.bubbleBarController; mBubbleBarViewController = bubbleControllers.bubbleBarViewController; mBubbleDismissController = bubbleControllers.bubbleDismissController; mBubbleBarPinController = bubbleControllers.bubbleBarPinController; mBubblePinController = bubbleControllers.bubblePinController; + mBubbleBarLocationListener = bubbleBarLocationListener; mBubbleDismissController.setListener( stuck -> { if (stuck) { @@ -690,13 +694,19 @@ public class BubbleDragController { if (to instanceof DragZone.Bubble.Left && mBubbleBarLocation != BubbleBarLocation.LEFT) { if (draggedObject instanceof DraggedObject.Bubble) { + // listener will be notified by BubbleBarController mBubbleBarController.animateBubbleBarLocation(BubbleBarLocation.LEFT); + } else { + // otherwise notify listener manually + mBubbleBarLocationListener.onBubbleBarLocationAnimated(BubbleBarLocation.LEFT); } mBubbleBarLocation = BubbleBarLocation.LEFT; } else if (to instanceof DragZone.Bubble.Right && mBubbleBarLocation != BubbleBarLocation.RIGHT) { if (draggedObject instanceof DraggedObject.Bubble) { mBubbleBarController.animateBubbleBarLocation(BubbleBarLocation.RIGHT); + } else { + mBubbleBarLocationListener.onBubbleBarLocationAnimated(BubbleBarLocation.RIGHT); } mBubbleBarLocation = BubbleBarLocation.RIGHT; }