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

Commit 03a2ab1e authored by Liran Binyamin's avatar Liran Binyamin
Browse files

Animate bubble update notifications

Updates to existing bubbles now cause the bubble bar to animate in
similarly to new bubble notifications.

Flag: ACONFIG com.android.wm.shell.enable_bubble_bar DEVELOPMENT
Bug: 280605846
Test: manual
Change-Id: Ib53316889170e0392f055242c6206882084b4a46
parent 3fcdc0a3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -322,7 +322,6 @@ public class BubbleBarController extends IBubblesListener.Stub {
        final boolean suppressAnimation =
                update.initialState || mBubbleBarViewController.isHiddenForSysui();

        BubbleBarItem previouslySelectedBubble = mSelectedBubble;
        BubbleBarBubble bubbleToSelect = null;
        if (!update.removedBubbles.isEmpty()) {
            for (int i = 0; i < update.removedBubbles.size(); i++) {
@@ -378,6 +377,7 @@ public class BubbleBarController extends IBubblesListener.Stub {
            BubbleBarBubble bb = mBubbles.get(update.updatedBubble.getKey());
            // If we're not stashed, we're visible so animate
            bb.getView().updateDotVisibility(!mBubbleStashController.isStashed() /* animate */);
            mBubbleBarViewController.animateBubbleNotification(bb, /* isExpanding= */ false);
        }
        if (update.bubbleKeysInOrder != null && !update.bubbleKeysInOrder.isEmpty()) {
            // Create the new list
+18 −18
Original line number Diff line number Diff line
@@ -414,14 +414,17 @@ public class BubbleBarViewController {
            b.getView().setOnClickListener(mBubbleClickListener);
            mBubbleDragController.setupBubbleView(b.getView());

            if (suppressAnimation) {
            if (suppressAnimation || !(b instanceof BubbleBarBubble bubble)) {
                return;
            }

            if (!(b instanceof BubbleBarBubble bubble)) {
                return;
            animateBubbleNotification(bubble, isExpanding);
        } else {
            Log.w(TAG, "addBubble, bubble was null!");
        }
    }

    /** Animates the bubble bar to notify the user about a bubble change. */
    public void animateBubbleNotification(BubbleBarBubble bubble, boolean isExpanding) {
        boolean isInApp = mTaskbarStashController.isInApp();
        // if this is the first bubble, animate to the initial state. one bubble is the overflow
        // so check for at most 2 children.
@@ -434,9 +437,6 @@ public class BubbleBarViewController {
        if (isInApp && !isExpanding && !isExpanded()) {
            mBubbleBarViewAnimator.animateBubbleInForStashed(bubble);
        }
        } else {
            Log.w(TAG, "addBubble, bubble was null!");
        }
    }

    /**