diff options
3 files changed, 13 insertions, 0 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java index fca8a625811c..949a7236434a 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java @@ -734,6 +734,9 @@ public class BubbleController implements ConfigurationChangeListener, public void setBubbleBarLocation(BubbleBarLocation bubbleBarLocation) { if (canShowAsBubbleBar()) { mBubblePositioner.setBubbleBarLocation(bubbleBarLocation); + if (mLayerView != null && !mLayerView.isExpandedViewDragged()) { + mLayerView.updateExpandedView(); + } BubbleBarUpdate bubbleBarUpdate = new BubbleBarUpdate(); bubbleBarUpdate.bubbleBarLocation = bubbleBarLocation; mBubbleStateListener.onBubbleStateChange(bubbleBarUpdate); diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarExpandedViewDragController.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarExpandedViewDragController.kt index fa1091c63d00..d45ed0d28f3b 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarExpandedViewDragController.kt +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarExpandedViewDragController.kt @@ -38,6 +38,9 @@ class BubbleBarExpandedViewDragController( var isStuckToDismiss: Boolean = false private set + var isDragged: Boolean = false + private set + private var expandedViewInitialTranslationX = 0f private var expandedViewInitialTranslationY = 0f private val magnetizedExpandedView: MagnetizedObject<BubbleBarExpandedView> = @@ -94,6 +97,7 @@ class BubbleBarExpandedViewDragController( // While animating, don't allow new touch events if (expandedView.isAnimating) return false pinController.onDragStart(bubblePositioner.isBubbleBarOnLeft) + isDragged = true return true } @@ -141,6 +145,7 @@ class BubbleBarExpandedViewDragController( dismissView.hide() } isMoving = false + isDragged = false } } diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarLayerView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarLayerView.java index badc40997902..9fa85cf0c57c 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarLayerView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarLayerView.java @@ -175,6 +175,11 @@ public class BubbleBarLayerView extends FrameLayout return mIsExpanded; } + /** Return whether the expanded view is being dragged */ + public boolean isExpandedViewDragged() { + return mDragController != null && mDragController.isDragged(); + } + /** Shows the expanded view of the provided bubble. */ public void showExpandedView(BubbleViewProvider b) { BubbleBarExpandedView expandedView = b.getBubbleBarExpandedView(); |