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

Commit 2a235a99 authored by Mady Mellor's avatar Mady Mellor
Browse files

Fix an issue where animated the bubble bar twice from bubble button

Only animate selection changed events when the bubble bar is already
expanded, this is because we delay the expanded view showing until
the bubble bar has animated & we should wait for that signal if
we're not already expanded.

Also added a check to skip the animation if we're already showing
that bubble.

Flag: com.android.wm.shell.enable_bubble_bar
Test: manual - create a bubble from a notification and observe the
               animation
             - check that switching between bubbles still works fine
Test: atest BubblesTest
Bug: 366048860
Change-Id: I3f8341eeab645057a97b1154d221580d88d79eac
parent 1ce71c6e
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -1241,8 +1241,9 @@ public class BubbleController implements ConfigurationChangeListener,
            mBubbleData.dismissBubbleWithKey(
                    bubbleKey, Bubbles.DISMISS_USER_GESTURE_FROM_LAUNCHER, timestamp);
        }
        if (selectedBubbleKey != null && !selectedBubbleKey.equals(bubbleKey)) {
            // We did not remove the selected bubble. Expand it again
        if (mBubbleData.hasBubbles()) {
            // We still have bubbles, if we dragged an individual bubble to dismiss we were expanded
            // so re-expand to whatever is selected.
            showExpandedViewForBubbleBar();
        }
    }
@@ -2007,7 +2008,7 @@ public class BubbleController implements ConfigurationChangeListener,
        @Override
        public void selectionChanged(BubbleViewProvider selectedBubble) {
            // Only need to update the layer view if we're currently expanded for selection changes.
            if (mLayerView != null && isStackExpanded()) {
            if (mLayerView != null && mLayerView.isExpanded()) {
                mLayerView.showExpandedView(selectedBubble);
            }
        }
+4 −0
Original line number Diff line number Diff line
@@ -186,6 +186,10 @@ public class BubbleBarLayerView extends FrameLayout
        if (expandedView == null) {
            return;
        }
        if (mExpandedBubble != null && mIsExpanded && b.getKey().equals(mExpandedBubble.getKey())) {
            // Already showing this bubble, skip animating
            return;
        }
        if (mExpandedBubble != null && !b.getKey().equals(mExpandedBubble.getKey())) {
            removeView(mExpandedView);
            mExpandedView = null;