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

Commit 8c40ca74 authored by Sergey Serokurov's avatar Sergey Serokurov Committed by Android (Google) Code Review
Browse files

Merge "Do not show overflow after the last bubble dismissed (in master)."

parents a45ebad5 bf4301f5
Loading
Loading
Loading
Loading
+4 −11
Original line number Diff line number Diff line
@@ -561,18 +561,11 @@ public class BubbleData {
        overflowBubble(reason, bubbleToRemove);

        if (mBubbles.size() == 1) {
            if (hasOverflowBubbles() && (mPositioner.showingInTaskbar() || isExpanded())) {
                // No more active bubbles but we have stuff in the overflow -- select that view
                // if we're already expanded or always showing.
                setShowingOverflow(true);
                setSelectedBubbleInternal(mOverflow);
            } else {
            setExpandedInternal(false);
            // Don't use setSelectedBubbleInternal because we don't want to trigger an
            // applyUpdate
            mSelectedBubble = null;
        }
        }
        if (indexToRemove < mBubbles.size() - 1) {
            // Removing anything but the last bubble means positions will change.
            mStateChange.orderChanged = true;
+2 −2
Original line number Diff line number Diff line
@@ -793,7 +793,7 @@ public class BubbleDataTest extends ShellTestCase {
    }

    @Test
    public void test_expanded_removeLastBubble_showsOverflowIfNotEmpty() {
    public void test_expanded_removeLastBubble_collapsesIfOverflowNotEmpty() {
        // Setup
        sendUpdatedEntryAtTime(mEntryA1, 1000);
        changeExpandedStateAtTime(true, 2000);
@@ -803,7 +803,7 @@ public class BubbleDataTest extends ShellTestCase {
        mBubbleData.dismissBubbleWithKey(mEntryA1.getKey(), Bubbles.DISMISS_USER_GESTURE);
        verifyUpdateReceived();
        assertThat(mBubbleData.getOverflowBubbles().size()).isGreaterThan(0);
        assertSelectionChangedTo(mBubbleData.getOverflow());
        assertExpandedChangedTo(false);
    }

    @Test