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

Commit fb43bb6b authored by András Kurucz's avatar András Kurucz Committed by Android (Google) Code Review
Browse files

Merge "[Flexiglass] Add a shadow to HUNs over GONE" into main

parents 332a4451 5611f3b3
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -145,6 +145,20 @@ class StackScrollAlgorithmTest(flags: FlagsParameterization) : SysuiTestCase() {
        resetViewStates_hunYTranslationIs(headsUpTop)
    }

    @Test
    @EnableSceneContainer
    fun resetViewStates_defaultHun_hasShadow() {
        val headsUpTop = 200f
        ambientState.headsUpTop = headsUpTop

        whenever(notificationRow.isPinned).thenReturn(true)
        whenever(notificationRow.isHeadsUp).thenReturn(true)

        stackScrollAlgorithm.resetViewStates(ambientState, 0)

        assertThat(notificationRow.viewState.zTranslation).isGreaterThan(baseZ)
    }

    @Test
    @DisableSceneContainer
    fun resetViewStates_defaultHunWhenShadeIsOpening_yTranslationIsInset() {
+1 −0
Original line number Diff line number Diff line
@@ -4265,6 +4265,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
            pw.print(", isPinned: " + isPinned());
            pw.print(", expandedWhenPinned: " + mExpandedWhenPinned);
            pw.print(", isMinimized: " + mIsMinimized);
            pw.print(", isAboveShelf: " + isAboveShelf());

            pw.println();
            if (NotificationContentView.INCLUDE_HEIGHTS_TO_DUMP) {
+9 −5
Original line number Diff line number Diff line
@@ -1227,13 +1227,17 @@ public class StackScrollAlgorithm {
        float baseZ = ambientState.getBaseZHeight();

        if (SceneContainerFlag.isEnabled()) {
            // SceneContainer flags off this logic, and just sets the baseZ because:
            // SceneContainer simplifies this logic, because:
            // - there are no overlapping HUNs anymore, no need for multiplying their shadows
            // - shadows for HUNs overlapping with the stack are now set from updateHeadsUpStates
            // - shadows for HUNs overlapping with the shelf are NOT set anymore, because it only
            // happens on AOD/Pulsing, where they're displayed on a black background so a shadow
            // wouldn't be visible.
            if (child.isPinned() || ambientState.getTrackedHeadsUpRow() == child) {
                // set a default elevation on the HUN, which would be overridden
                // from updateHeadsUpStates if it is displayed in the shade
                childViewState.setZTranslation(baseZ + mPinnedZTranslationExtra);
            } else {
                // set baseZ for every notification
                childViewState.setZTranslation(baseZ);
            }
        } else {
            if (child.mustStayOnScreen() && !childViewState.headsUpIsVisible
                    && !ambientState.isDozingAndNotPulsing(child)