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

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

Unread dot for overflow button

Show dot if overflow has unread bubbles

Fixes: 162595718
Test: Dismiss/age unread bubble into overflow: dot shows
Test: Promote/overflow unread bubble out of overflow: dot hides

Change-Id: Ic6275d2fa791657bf24cccbe26bd56119f8ea485
parent 0138bf5f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1328,6 +1328,8 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
            // Lazy load overflow bubbles from disk
            loadOverflowBubblesFromDisk();

            mStackView.updateOverflowButtonDot();

            // Update bubbles in overflow.
            if (mOverflowListener != null) {
                mOverflowListener.applyUpdate(update);
+8 −1
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ class BubbleOverflow(
    private var bitmapSize = 0
    private var iconBitmapSize = 0
    private var dotColor = 0
    private var showDot = false

    private val inflater: LayoutInflater = LayoutInflater.from(context)
    private val expandedView: BubbleExpandedView = inflater
@@ -118,12 +119,18 @@ class BubbleOverflow(

        // Attach BubbleOverflow to BadgedImageView
        overflowBtn.setRenderedBubble(this)
        overflowBtn.removeDotSuppressionFlag(BadgedImageView.SuppressionFlag.FLYOUT_VISIBLE)
    }

    fun setVisible(visible: Int) {
        overflowBtn.visibility = visible
    }

    fun setShowDot(show: Boolean) {
        showDot = show
        overflowBtn.updateDotVisibility(true /* animate */)
    }

    override fun getExpandedView(): BubbleExpandedView? {
        return expandedView
    }
@@ -141,7 +148,7 @@ class BubbleOverflow(
    }

    override fun showDot(): Boolean {
        return false
        return showDot
    }

    override fun getDotPath(): Path? {
+10 −0
Original line number Diff line number Diff line
@@ -1162,6 +1162,16 @@ public class BubbleStackView extends FrameLayout
        updateOverflowVisibility();
    }

    void updateOverflowButtonDot() {
        for (Bubble b : mBubbleData.getOverflowBubbles()) {
            if (b.showDot()) {
                mBubbleOverflow.setShowDot(true);
                return;
            }
        }
        mBubbleOverflow.setShowDot(false);
    }

    /**
     * Handle theme changes.
     */