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

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

Merge "Rename removeBubble method to clarify it is for dismissing via drag" into main

parents 80b1ee37 50eb8e78
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -506,12 +506,10 @@ public class BubbleBarViewController {

    /**
     * Notifies SystemUI to expand the selected bubble when the bubble is released.
     * @param bubbleView dragged bubble view
     */
    public void onDragRelease(@NonNull BubbleView bubbleView, BubbleBarLocation location) {
        if (bubbleView.getBubble() == null) return;
    public void onDragRelease(BubbleBarLocation location) {
        // TODO(b/330585402): send new bubble bar bounds to shell for the animation
        mSystemUiProxy.stopBubbleDrag(bubbleView.getBubble().getKey(), location);
        mSystemUiProxy.stopBubbleDrag(location);
    }

    /**
@@ -556,7 +554,7 @@ public class BubbleBarViewController {
     * @param bubble dismissed bubble item
     */
    public void onDismissBubbleWhileDragging(@NonNull BubbleBarItem bubble) {
        mSystemUiProxy.removeBubble(bubble.getKey());
        mSystemUiProxy.dragBubbleToDismiss(bubble.getKey());
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ public class BubbleDragController {
            @Override
            protected void onDragRelease() {
                mBubblePinController.onDragEnd();
                mBubbleBarViewController.onDragRelease(bubbleView, mReleasedLocation);
                mBubbleBarViewController.onDragRelease(mReleasedLocation);
            }

            @Override
+15 −16
Original line number Diff line number Diff line
@@ -773,19 +773,6 @@ public class SystemUiProxy implements ISystemUiProxy, NavHandle, SafeCloseable {
        }
    }

    /**
     * Tells SysUI to remove the bubble with the provided key.
     * @param key the key of the bubble to show.
     */
    public void removeBubble(String key) {
        if (mBubbles == null) return;
        try {
            mBubbles.removeBubble(key);
        } catch (RemoteException e) {
            Log.w(TAG, "Failed call removeBubble");
        }
    }

    /**
     * Tells SysUI to remove all bubbles.
     */
@@ -828,18 +815,30 @@ public class SystemUiProxy implements ISystemUiProxy, NavHandle, SafeCloseable {
    /**
     * Tells SysUI when the bubble stops being dragged.
     * Should be called only when the bubble bar is expanded.
     * @param bubbleKey key of the bubble being dragged
     * @param location location of the bubble bar
     */
    public void stopBubbleDrag(@Nullable String bubbleKey, BubbleBarLocation location) {
    public void stopBubbleDrag(BubbleBarLocation location) {
        if (mBubbles == null) return;
        try {
            mBubbles.stopBubbleDrag(bubbleKey, location);
            mBubbles.stopBubbleDrag(location);
        } catch (RemoteException e) {
            Log.w(TAG, "Failed call stopBubbleDrag");
        }
    }

    /**
     * Tells SysUI to dismiss the bubble with the provided key.
     * @param key the key of the bubble to dismiss.
     */
    public void dragBubbleToDismiss(String key) {
        if (mBubbles == null) return;
        try {
            mBubbles.dragBubbleToDismiss(key);
        } catch (RemoteException e) {
            Log.w(TAG, "Failed call dragBubbleToDismiss");
        }
    }

    /**
     * Tells SysUI to show user education relative to the reference point provided.
     * @param position the bubble bar top center position in Screen coordinates.