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

Commit 886cfb2a authored by Ats Jenk's avatar Ats Jenk Committed by Android (Google) Code Review
Browse files

Merge "Update bubble bar expanded view when bubble bar location updates" into main

parents 6386517f 5f6a1fc9
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();