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

Commit e247cd04 authored by Ioana Alexandru's avatar Ioana Alexandru
Browse files

[Notif redesign] Expander: always show number for groups

Previously, we were only showing the number when the group was
collapsed. In the redesign, we now want to show it all the time.

Bug: 378660052
Test: visual test, screenshot tests to come later
Flag: android.app.notifications_redesign_templates
Change-Id: I6a3a7e72157d89ceda0a43432a8da2e6131fbf4d
parent c92d93f8
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -149,9 +149,11 @@ public class NotificationExpandButton extends FrameLayout {
        setContentDescription(mContext.getText(contentDescriptionId));
        mIconView.setImageDrawable(getContext().getDrawable(drawableId));

        if (!notificationsRedesignTemplates()) {
            // changing the expanded state can affect the number display
            updateNumber();
        }
    }

    private void updateNumber() {
        if (shouldShowNumber()) {
@@ -189,6 +191,9 @@ public class NotificationExpandButton extends FrameLayout {
    }

    private boolean shouldShowNumber() {
        if (notificationsRedesignTemplates()) {
            return mNumber > 1;
        }
        return !mExpanded && mNumber > 1;
    }

@@ -230,7 +235,7 @@ public class NotificationExpandButton extends FrameLayout {

    /**
     * Sets the number shown inside the expand button.
     * This only appears when the expand button is collapsed, and when greater than 1.
     * This only appears when {@link this#shouldShowNumber()} is true.
     */
    @RemotableViewMethod
    public void setNumber(int number) {