OSDN Git Service

[Notif] Remove transient views on swipe out
authorRohan Shah <shahrk@google.com>
Tue, 22 May 2018 17:59:30 +0000 (10:59 -0700)
committerRohan Shah <shahrk@google.com>
Thu, 24 May 2018 00:10:43 +0000 (17:10 -0700)
We are not removing transient views for the 'swiped out' animation.
Utilizing the transient view cleanup in onAnimationFinished to handle
this better.

Test: Manually
Bug: 79896012
Change-Id: I3c169815433e34795472264de30ff23b3d744269

packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java

index dc4b697..5fe3c6c 100644 (file)
@@ -3290,6 +3290,16 @@ public class NotificationStackScrollLayout extends ViewGroup
             if (!childWasSwipedOut) {
                 Rect clipBounds = child.getClipBounds();
                 childWasSwipedOut = clipBounds != null && clipBounds.height() == 0;
+
+                if (childWasSwipedOut && child instanceof ExpandableView) {
+                    // Clean up any potential transient views if the child has already been swiped
+                    // out, as we won't be animating it further (due to its height already being
+                    // clipped to 0.
+                    ViewGroup transientContainer = ((ExpandableView) child).getTransientContainer();
+                    if (transientContainer != null) {
+                        transientContainer.removeTransientView(child);
+                    }
+                }
             }
             int animationType = childWasSwipedOut
                     ? AnimationEvent.ANIMATION_TYPE_REMOVE_SWIPED_OUT