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

Commit d9ceae05 authored by Josh Tsuji's avatar Josh Tsuji Committed by Android (Google) Code Review
Browse files

Merge changes I90893f1e,I40cee68d into qt-r1-bubbles-dev

* changes:
  Without modifying existing logic, animate out bubbles in reverse of the way they animate in.
  Revert "Animate out bubbles in reverse of the way they animate in."
parents eac85d69 fa8e4216
Loading
Loading
Loading
Loading
+15 −19
Original line number Diff line number Diff line
@@ -806,34 +806,30 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
        if (mStatusBarStateListener.getCurrentState() == SHADE && hasBubbles()) {
            // Bubbles only appear in unlocked shade
            mStackView.setVisibility(hasBubbles() ? VISIBLE : INVISIBLE);
        } else if (!hasBubbles() && mStackView.hasTransientBubbles()) {
            // If we only have transient bubbles, then wait until they're gone.
            mStackView.runActionAfterTransientViewAnimations(() -> {
                mStackView.setVisibility(INVISIBLE);
                updateBubblesShowing();
            });
        } else {
        } else if (mStackView != null) {
            mStackView.setVisibility(INVISIBLE);
        }

        updateBubblesShowing();
    }

    /**
     * Updates the status bar window controller and the state change listener with whether bubbles
     * are currently showing.
     */
    public void updateBubblesShowing() {
        // Let listeners know if bubble state changed.
        boolean hadBubbles = mStatusBarWindowController.getBubblesShowing();
        boolean hasBubblesShowing =
                (hasBubbles() || mStackView.hasTransientBubbles())
                        && mStackView.getVisibility() == VISIBLE;
        mStatusBarWindowController.setBubblesShowing(hasBubblesShowing);
        boolean hasBubblesShowing = hasBubbles() && mStackView.getVisibility() == VISIBLE;
        if (mStateChangeListener != null && hadBubbles != hasBubblesShowing) {
            mStateChangeListener.onHasBubblesChanged(hasBubblesShowing);
        }

        mStackView.updateContentDescription();

        // If we don't have bubbles, but there's transient bubbles, keep the stack view visible and
        // the status bar window expanded until they finish animating out.
        if (!hasBubbles() && mStackView.hasTransientBubbles()) {
            mStackView.setVisibility(VISIBLE);
            mStackView.runActionAfterTransientViewAnimations(() -> {
                mStackView.setVisibility(INVISIBLE);
                mStatusBarWindowController.setBubblesShowing(false);
            });
        } else {
            mStatusBarWindowController.setBubblesShowing(hasBubblesShowing);
        }
    }

    /**
+0 −2
Original line number Diff line number Diff line
@@ -224,7 +224,6 @@ public class BubbleControllerTest extends SysuiTestCase {
        verify(mBubbleStateChangeListener).onHasBubblesChanged(true);

        mBubbleController.removeBubble(mRow.getEntry().key, BubbleController.DISMISS_USER_GESTURE);
        assertFalse(mStatusBarWindowController.getBubblesShowing());
        assertNull(mBubbleData.getBubbleWithKey(mRow.getEntry().key));
        verify(mNotificationEntryManager, times(2)).updateNotifications();
        verify(mBubbleStateChangeListener).onHasBubblesChanged(false);
@@ -262,7 +261,6 @@ public class BubbleControllerTest extends SysuiTestCase {
        assertTrue(mBubbleController.hasBubbles());

        mBubbleController.dismissStack(BubbleController.DISMISS_USER_GESTURE);
        assertFalse(mStatusBarWindowController.getBubblesShowing());
        verify(mNotificationEntryManager, times(3)).updateNotifications();
        assertNull(mBubbleData.getBubbleWithKey(mRow.getEntry().key));
        assertNull(mBubbleData.getBubbleWithKey(mRow2.getEntry().key));