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

Commit 606e9fde authored by Liran Binyamin's avatar Liran Binyamin Committed by Android (Google) Code Review
Browse files

Merge "Animate bubble update notifications" into main

parents c36afd3e 03a2ab1e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -323,7 +323,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++) {
@@ -379,6 +378,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!");
        }
    }

    /**