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

Commit 17e542d9 authored by András Kurucz's avatar András Kurucz
Browse files

Keep the pulsing notifications in place while animating away

Keep the pulsing HUNs at their original translateY animation while
animating away.

Bug: 325939444
Test: atest StackScrollAlgorithmTest
Test: Post alerting notifications on the AOD, see how they animate away.
Flag: ACONFIG com.android.systemui.notifications_improved_hun_animation TEAMFOOD

Change-Id: Ifb36db455cc65eaa465319b91daaf7d9dfaa00c1
parent d6ab40bc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -853,7 +853,7 @@ public class StackScrollAlgorithm {
                }
            }
            if (row.isHeadsUpAnimatingAway()) {
                if (NotificationsImprovedHunAnimation.isEnabled()) {
                if (NotificationsImprovedHunAnimation.isEnabled() && !ambientState.isDozing()) {
                    if (shouldHunAppearFromBottom(ambientState, childState)) {
                        // move to the bottom of the screen
                        childState.setYTranslation(
+20 −0
Original line number Diff line number Diff line
@@ -221,6 +221,26 @@ class StackScrollAlgorithmTest : SysuiTestCase() {
        assertThat(notificationRow.viewState.clipBottomAmount).isEqualTo(0)
    }

    @Test
    @EnableFlags(NotificationsImprovedHunAnimation.FLAG_NAME)
    fun resetViewStates_hunAnimatingAwayWhileDozing_yTranslationIsInset() {
        whenever(notificationRow.isHeadsUpAnimatingAway).thenReturn(true)

        ambientState.isDozing = true

        resetViewStates_hunYTranslationIs(stackScrollAlgorithm.mHeadsUpInset)
    }

    @Test
    @EnableFlags(NotificationsImprovedHunAnimation.FLAG_NAME)
    fun resetViewStates_hunAnimatingAwayWhileDozing_hasStackMargin_changesHunYTranslation() {
        whenever(notificationRow.isHeadsUpAnimatingAway).thenReturn(true)

        ambientState.isDozing = true

        resetViewStates_stackMargin_changesHunYTranslation()
    }

    @Test
    fun resetViewStates_hunsOverlapping_bottomHunClipped() {
        val topHun = mockExpandableNotificationRow()