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

Commit 434180ce authored by Mady Mellor's avatar Mady Mellor
Browse files

Fix notification shelf icon showing on top of snooze leave behind

Also fixes an issue where the guts closed listener would always call
onHeightChanged because the notification isn’t marked as removed
until after the listener gets called.

Fixes: 34866027
Test: Manual - have one notification, snooze it
Change-Id: Ic67bdb353b8bb5df8bdaaf6d3e71ade7da05ee46
parent 1f8a47ca
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -40,6 +40,8 @@ public interface NotificationMenuRowProvider extends Plugin {
        public View getContentView();

        public boolean handleCloseControls(boolean save);

        public boolean willBeRemoved();
    }

    public interface SnoozeGutsContent extends GutsContent {
+3 −0
Original line number Diff line number Diff line
@@ -879,6 +879,9 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
     * @return whether the notification is currently showing a view with an icon.
     */
    public boolean isShowingIcon() {
        if (areGutsExposed()) {
            return false;
        }
        if (mIsSummaryWithChildren) {
            return true;
        }
+4 −0
Original line number Diff line number Diff line
@@ -244,6 +244,10 @@ public class NotificationGuts extends FrameLayout
        }
    }

    public boolean willBeRemoved() {
        return mGutsContent != null ? mGutsContent.willBeRemoved() : false;
    }

    public boolean isExposed() {
        return mExposed;
    }
+5 −0
Original line number Diff line number Diff line
@@ -273,6 +273,11 @@ public class NotificationInfo extends LinearLayout implements GutsContent {
        mGutsInteractionListener = listener;
    }

    @Override
    public boolean willBeRemoved() {
        return !mChannelEnabledSwitch.isChecked();
    }

    @Override
    public View getContentView() {
        return this;
+4 −3
Original line number Diff line number Diff line
@@ -379,11 +379,12 @@ public class NotificationShelf extends ActivatableNotificationView {
                : 0.0f;
        row.setContentTransformationAmount(contentTransformationAmount, isLastChild);
        setIconTransformationAmount(row, transitionAmount, iconTransformDistance,
                clampedAmount != transitionAmount);
                clampedAmount != transitionAmount, isLastChild);
    }

    private void setIconTransformationAmount(ExpandableNotificationRow row,
            float transitionAmount, float iconTransformDistance, boolean usingLinearInterpolation) {
            float transitionAmount, float iconTransformDistance, boolean usingLinearInterpolation,
            boolean isLastChild) {
        StatusBarIconView icon = row.getEntry().expandedIcon;
        NotificationIconContainer.IconState iconState = getIconState(icon);

@@ -435,7 +436,7 @@ public class NotificationShelf extends ActivatableNotificationView {
                iconState.scaleY = 1.0f;
                iconState.hidden = false;
            }
            if (row.isAboveShelf()) {
            if (row.isAboveShelf() || (!row.isInShelf() && isLastChild && row.areGutsExposed())) {
                iconState.hidden = true;
            }
        }
Loading