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

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

Merge "Send new bubble bar location with the drag end notification" into main

parents 1fc80a64 d2f64548
Loading
Loading
Loading
Loading
+28 −6
Original line number Diff line number Diff line
@@ -1162,12 +1162,29 @@ public class BubbleController implements ConfigurationChangeListener,
    }

    /**
     * Update expanded state when a single bubble is dragged in Launcher.
     * A bubble is being dragged in Launcher.
     * Will be called only when bubble bar is expanded.
     * @param bubbleKey key of the bubble to collapse/expand
     * @param isBeingDragged whether the bubble is being dragged
     *
     * @param bubbleKey key of the bubble being dragged
     */
    public void startBubbleDrag(String bubbleKey) {
        onBubbleDrag(bubbleKey, true /* isBeingDragged */);
    }

    /**
     * A bubble is no longer being dragged in Launcher. As was released in given location.
     * Will be called only when bubble bar is expanded.
     *
     * @param bubbleKey key of the bubble being dragged
     * @param location  location where bubble was released
     */
    public void onBubbleDrag(String bubbleKey, boolean isBeingDragged) {
    public void stopBubbleDrag(String bubbleKey, BubbleBarLocation location) {
        mBubblePositioner.setBubbleBarLocation(location);
        onBubbleDrag(bubbleKey, false /* isBeingDragged */);
    }

    private void onBubbleDrag(String bubbleKey, boolean isBeingDragged) {
        // TODO(b/330585402): collapse stack if any bubble is dragged
        if (mBubbleData.getSelectedBubble() != null
                && mBubbleData.getSelectedBubble().getKey().equals(bubbleKey)) {
            // Should collapse/expand only if equals to selected bubble.
@@ -2329,8 +2346,13 @@ public class BubbleController implements ConfigurationChangeListener,
        }

        @Override
        public void onBubbleDrag(String bubbleKey, boolean isBeingDragged) {
            mMainExecutor.execute(() -> mController.onBubbleDrag(bubbleKey, isBeingDragged));
        public void startBubbleDrag(String bubbleKey) {
            mMainExecutor.execute(() -> mController.startBubbleDrag(bubbleKey));
        }

        @Override
        public void stopBubbleDrag(String bubbleKey, BubbleBarLocation location) {
            mMainExecutor.execute(() -> mController.stopBubbleDrag(bubbleKey, location));
        }

        @Override
+3 −1
Original line number Diff line number Diff line
@@ -39,11 +39,13 @@ interface IBubbles {

    oneway void collapseBubbles() = 6;

    oneway void onBubbleDrag(in String key, in boolean isBeingDragged) = 7;
    oneway void startBubbleDrag(in String key) = 7;

    oneway void showUserEducation(in int positionX, in int positionY) = 8;

    oneway void setBubbleBarLocation(in BubbleBarLocation location) = 9;

    oneway void setBubbleBarBounds(in Rect bubbleBarBounds) = 10;

    oneway void stopBubbleDrag(in String key, in BubbleBarLocation location) = 11;
}
 No newline at end of file