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

Commit c21852a1 authored by Liran Binyamin's avatar Liran Binyamin
Browse files

Suppress animation for bubbles that auto expand

Check whether the state update indicates that the bubble bar is expanding, and pass that to the bubblebarviewcontroller so that we can suppress the new bubble animation if we're expanding from stashed.
Note that in some cases the notification service may not include the auto expand flag on the message it sends to sysui, so launcher will end up getting 2 separate messages. We may need to handle that separately.

Flag: ACONFIG com.android.wm.shell.enable_bubble_bar DEVELOPMENT
Bug: 280605846
Test: manual
       - create bubble that auto expands
       - observe that the bubble does not animate
       - note that in some cases the notification service may not include the auto expand flag, will look into that separately.
Change-Id: Id7e2db5fd32d391413c57d83effb4b23b1085125
parent 966156e3
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -237,7 +237,7 @@ public class BubbleBarController extends IBubblesListener.Stub {
                // we're on the main executor now, so check that the overflow hasn't been created
                // again to avoid races.
                if (mOverflowBubble == null) {
                    mBubbleBarViewController.addBubble(overflow);
                    mBubbleBarViewController.addBubble(overflow, /* isExpanding= */ false);
                    mOverflowBubble = overflow;
                }
            });
@@ -306,6 +306,7 @@ public class BubbleBarController extends IBubblesListener.Stub {
    private void applyViewChanges(BubbleBarViewUpdate update) {
        final boolean isCollapsed = (update.expandedChanged && !update.expanded)
                || (!update.expandedChanged && !mBubbleBarViewController.isExpanded());
        final boolean isExpanding = update.expandedChanged && update.expanded;
        BubbleBarItem previouslySelectedBubble = mSelectedBubble;
        BubbleBarBubble bubbleToSelect = null;
        if (!update.removedBubbles.isEmpty()) {
@@ -322,7 +323,7 @@ public class BubbleBarController extends IBubblesListener.Stub {
        }
        if (update.addedBubble != null) {
            mBubbles.put(update.addedBubble.getKey(), update.addedBubble);
            mBubbleBarViewController.addBubble(update.addedBubble);
            mBubbleBarViewController.addBubble(update.addedBubble, isExpanding);
            if (isCollapsed) {
                // If we're collapsed, the most recently added bubble will be selected.
                bubbleToSelect = update.addedBubble;
@@ -335,7 +336,7 @@ public class BubbleBarController extends IBubblesListener.Stub {
                BubbleBarBubble bubble = update.currentBubbles.get(i);
                if (bubble != null) {
                    mBubbles.put(bubble.getKey(), bubble);
                    mBubbleBarViewController.addBubble(bubble);
                    mBubbleBarViewController.addBubble(bubble, isExpanding);
                    if (isCollapsed) {
                        // If we're collapsed, the most recently added bubble will be selected.
                        bubbleToSelect = bubble;
+3 −2
Original line number Diff line number Diff line
@@ -315,7 +315,7 @@ public class BubbleBarViewController {
    /**
     * Adds the provided bubble to the bubble bar.
     */
    public void addBubble(BubbleBarItem b) {
    public void addBubble(BubbleBarItem b, boolean isExpanding) {
        if (b != null) {
            mBarView.addView(b.getView(), 0,
                    new FrameLayout.LayoutParams(mIconSize, mIconSize, Gravity.LEFT));
@@ -324,7 +324,8 @@ public class BubbleBarViewController {

            boolean isStashedOrGone =
                    mBubbleStashController.isStashed() || mBarView.getVisibility() != VISIBLE;
            if (b instanceof BubbleBarBubble && isStashedOrGone) {
            // don't animate the new bubble if we're auto expanding from stashed
            if (b instanceof BubbleBarBubble && isStashedOrGone && !isExpanding) {
                mBubbleBarViewAnimator.animateBubbleInForStashed((BubbleBarBubble) b);
            }
        } else {