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

Commit 90c2f356 authored by Lyn's avatar Lyn
Browse files

Fix corner roundness for pinned notifications

Sometimes the PINNED SourceType is not reset on transition from
floating HUN to shade. This causes heads up notifications to have
incorrectly rounded bottom corners despite having notifications
appear below them in the same section.

The PINNED SourceType is redundant because the HEADSUP
SourceType handles rounding for the same notifications.

For each HUN,
ExpandableNotificationRow request roundness for HEADSUP
HeadsUpAppearanceController requests roundness for PINNED

We can fix this bug by removing the redundant PINNED SourceType.
Fixes: 301261545

Test: send a lot of delayed HUNs, open shade
      => corners consistently correct

      swipe down on lockscreen/pulsing HUNs to open shade
      send delayed HUN while in fullscreen qs, close qs
      send HUN while scrolled, then unscroll
      horizontal swipe to dismiss single notifs
      clear all notifs
      => no corner regressions

Change-Id: Iadc76c251a77582f1c99652172fda882ce7d8abf
parent e4387bfe
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -139,7 +139,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
    private static final long RECENTLY_ALERTED_THRESHOLD_MS = TimeUnit.SECONDS.toMillis(30);
    private static final SourceType BASE_VALUE = SourceType.from("BaseValue");
    private static final SourceType FROM_PARENT = SourceType.from("FromParent(ENR)");
    private static final SourceType PINNED = SourceType.from("Pinned");

    // We don't correctly track dark mode until the content views are inflated, so always update
    // the background on first content update just in case it happens to be during a theme change.
@@ -147,7 +146,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
    private boolean mIsSnoozed;
    private boolean mShowSnooze = false;
    private boolean mIsFaded;
    private boolean mAnimatePinnedRoundness = false;

    /**
     * Listener for when {@link ExpandableNotificationRow} is laid out.
@@ -1053,14 +1051,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
        if (isAboveShelf() != wasAboveShelf) {
            mAboveShelfChangedListener.onAboveShelfStateChanged(!wasAboveShelf);
        }
        if (pinned) {
            // Should be animated if someone explicitly set it to 0 and the row is shown.
            boolean animated = mAnimatePinnedRoundness && isShown();
            requestRoundness(/* top = */ 1f, /* bottom = */ 1f, PINNED, animated);
        } else {
            requestRoundnessReset(PINNED);
            mAnimatePinnedRoundness = true;
        }
    }

    @Override