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

Commit 1901510f authored by Selim Cinek's avatar Selim Cinek
Browse files

Removed Notification Delays when adding / removing notifications

This leads to nicer transitions with physics rather than wobbling.

Outstanding (regardless of the physics flag or this change):
Fix overlapping notifications with row transparency.

Bug: 393581344
Test: manual
Flag: com.android.systemui.physical_notification_movement
Change-Id: I455f3b10fa091776275391e4cef9a5a1de309115
parent 5a532c10
Loading
Loading
Loading
Loading
+40 −20
Original line number Diff line number Diff line
@@ -6469,7 +6469,14 @@ public class NotificationStackScrollLayout
        static AnimationFilter[] FILTERS = new AnimationFilter[]{

                // ANIMATION_TYPE_ADD
                new AnimationFilter()
                physicalNotificationMovement()
                        ? new AnimationFilter()
                                .animateAlpha()
                                .animateHeight()
                                .animateTopInset()
                                .animateY()
                                .animateZ()
                        : new AnimationFilter()
                                .animateAlpha()
                                .animateHeight()
                                .animateTopInset()
@@ -6478,7 +6485,14 @@ public class NotificationStackScrollLayout
                                .hasDelays(),

                // ANIMATION_TYPE_REMOVE
                new AnimationFilter()
                physicalNotificationMovement()
                        ? new AnimationFilter()
                                .animateAlpha()
                                .animateHeight()
                                .animateTopInset()
                                .animateY()
                                .animateZ()
                        : new AnimationFilter()
                                .animateAlpha()
                                .animateHeight()
                                .animateTopInset()
@@ -6487,7 +6501,13 @@ public class NotificationStackScrollLayout
                                .hasDelays(),

                // ANIMATION_TYPE_REMOVE_SWIPED_OUT
                new AnimationFilter()
                physicalNotificationMovement()
                        ? new AnimationFilter()
                                .animateHeight()
                                .animateTopInset()
                                .animateY()
                                .animateZ()
                        : new AnimationFilter()
                                .animateHeight()
                                .animateTopInset()
                                .animateY()
+8 −0
Original line number Diff line number Diff line
@@ -289,6 +289,10 @@ public class StackStateAnimator {
            long delayPerElement = ANIMATION_DELAY_PER_ELEMENT_INTERRUPTING;
            switch (event.animationType) {
                case NotificationStackScrollLayout.AnimationEvent.ANIMATION_TYPE_ADD: {
                    if (physicalNotificationMovement()) {
                        // We don't want any delays when adding anymore
                        continue;
                    }
                    int ownIndex = viewState.notGoneIndex;
                    int changingIndex =
                            ((ExpandableView) (event.mChangingView)).getViewState().notGoneIndex;
@@ -302,6 +306,10 @@ public class StackStateAnimator {
                case NotificationStackScrollLayout.AnimationEvent.ANIMATION_TYPE_REMOVE_SWIPED_OUT:
                    delayPerElement = ANIMATION_DELAY_PER_ELEMENT_MANUAL;
                case NotificationStackScrollLayout.AnimationEvent.ANIMATION_TYPE_REMOVE: {
                    if (physicalNotificationMovement()) {
                        // We don't want any delays when removing anymore
                        continue;
                    }
                    int ownIndex = viewState.notGoneIndex;
                    boolean noNextView = event.viewAfterChangingView == null;
                    ExpandableView viewAfterChangingView = noNextView