OSDN Git Service

AOD padding animation should match slice
authorLucas Dupin <dupin@google.com>
Mon, 7 May 2018 23:00:11 +0000 (16:00 -0700)
committerLucas Dupin <dupin@google.com>
Tue, 8 May 2018 00:08:48 +0000 (17:08 -0700)
Top padding animates when a new notification arrives and same duration
should be used, otherwise elements would overlap.

Test: visual
Bug: 76110106
Change-Id: I016a796df93fd1b6852922bc646f616c68ec624e

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

index 7370c4c..5deebff 100644 (file)
@@ -3331,8 +3331,16 @@ public class NotificationStackScrollLayout extends ViewGroup
 
     private void generateTopPaddingEvent() {
         if (mTopPaddingNeedsAnimation) {
-            mAnimationEvents.add(
-                    new AnimationEvent(null, AnimationEvent.ANIMATION_TYPE_TOP_PADDING_CHANGED));
+            AnimationEvent event;
+            if (mAmbientState.isDark()) {
+                event = new AnimationEvent(null /* view */,
+                        AnimationEvent.ANIMATION_TYPE_TOP_PADDING_CHANGED,
+                        KeyguardSliceView.DEFAULT_ANIM_DURATION);
+            } else {
+                event = new AnimationEvent(null /* view */,
+                        AnimationEvent.ANIMATION_TYPE_TOP_PADDING_CHANGED);
+            }
+            mAnimationEvents.add(event);
         }
         mTopPaddingNeedsAnimation = false;
     }