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

Commit 5983e3e7 authored by Lyn Han's avatar Lyn Han Committed by Android (Google) Code Review
Browse files

Merge "Reuse bubble icon in overflow"

parents 08fa36a7 b719ac55
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -254,21 +254,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;
    }
@@ -328,7 +335,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
@@ -1487,7 +1487,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;