Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5f6a1fc9 authored by Ats Jenk's avatar Ats Jenk
Browse files

Update bubble bar expanded view when bubble bar location updates

We are introducing a new way to reposition the bubble bar through a11y
actions. This creates a new case where bubble bar location update comes
in from launcher while the expanded view is visible.
Previously we were always hiding the expanded view, while launcher was
updating the bubble bar location. And only updating the internal state
in positioner regarding bubble bar position.

Ensure that when bubble bar location change comes in, and bar is
expanded, we update the expanded view too.

Bug: 347028716
Flag: com.android.wm.shell.enable_bubble_bar
Test: check expanded view position and animation when updating bubble
  bar location by dragging from:
  - expanded view from handle
  - one bubble in bar
  - the entire bar
Change-Id: Ic21410562051ba26d2394e797f0ef87a0aea0a4c
parent 029499c8
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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);
+5 −0
Original line number Diff line number Diff line
@@ -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
        }
    }

+5 −0
Original line number Diff line number Diff line
@@ -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();