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

Commit b719ac55 authored by Lyn Han's avatar Lyn Han
Browse files

Reuse bubble icon in overflow

Skip icon removal for overflow bubbles
Skip view removal in Bubble#stopInflation
        BubbleStackView already removes views for removed bubbles
        BubbleData should not handle view removal

Test: no regressions
Change-Id: I01f4f0de5b140fa7c3a4487af71a41af52207592
parent 38cc1531
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -253,21 +253,28 @@ class Bubble implements BubbleViewProvider {
    }

    /**
     * Call when the views should be removed, ensure this is called to clean up ActivityView
     * content.
     * Cleanup expanded view for bubbles going into overflow.
     */
    void cleanupViews() {
    void cleanupExpandedView() {
        if (mExpandedView != null) {
            mExpandedView.cleanUpExpandedState();
            mExpandedView = null;
        }
        mIconView = null;
        if (mIntent != null) {
            mIntent.unregisterCancelListener(mIntentCancelListener);
        }
        mIntentActive = false;
    }

    /**
     * Call when the views should be removed, ensure this is called to clean up ActivityView
     * content.
     */
    void cleanupViews() {
        cleanupExpandedView();
        mIconView = null;
    }

    void setPendingIntentCanceled() {
        mPendingIntentCanceled = true;
    }
@@ -327,7 +334,6 @@ class Bubble implements BubbleViewProvider {
            return;
        }
        mInflationTask.cancel(true /* mayInterruptIfRunning */);
        cleanupViews();
    }

    void setViewInfo(BubbleViewInfoTask.BubbleViewInfo info) {
+5 −1
Original line number Diff line number Diff line
@@ -1492,7 +1492,11 @@ public class BubbleStackView extends FrameLayout
            if (v instanceof BadgedImageView
                    && ((BadgedImageView) v).getKey().equals(bubble.getKey())) {
                mBubbleContainer.removeViewAt(i);
                if (mBubbleData.hasOverflowBubbleWithKey(bubble.getKey())) {
                    bubble.cleanupExpandedView();
                } else {
                    bubble.cleanupViews();
                }
                updatePointerPosition();
                logBubbleEvent(bubble, SysUiStatsLog.BUBBLE_UICHANGED__ACTION__DISMISSED);
                return;