OSDN Git Service

Fixed that the shelf was animating the icons
authorSelim Cinek <cinek@google.com>
Mon, 8 May 2017 19:38:09 +0000 (12:38 -0700)
committerSelim Cinek <cinek@google.com>
Tue, 9 May 2017 23:45:32 +0000 (16:45 -0700)
When expanding instantly, the shelf was still animating
it's icons which shouldn't happen.

Change-Id: I76ceb4cc77a1830e555499fff9ce8b94c77b0bfe
Fixes: 37918141

packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java

index b134fc5..ea10c92 100644 (file)
@@ -70,6 +70,8 @@ public class NotificationShelf extends ActivatableNotificationView implements
     private float mMaxShelfEnd;
     private int mRelativeOffset;
     private boolean mInteractive;
+    private float mOpenedAmount;
+    private boolean mNoAnimationsInThisFrame;
     private boolean mAnimationsEnabled = true;
 
     public NotificationShelf(Context context, AttributeSet attrs) {
@@ -365,7 +367,8 @@ public class NotificationShelf extends ActivatableNotificationView implements
         } else {
             // We take the clamped position instead
             transitionAmount = clampedAmount;
-            iconState.needsCannedAnimation = iconState.clampedAppearAmount != clampedAmount;
+            iconState.needsCannedAnimation = iconState.clampedAppearAmount != clampedAmount
+                    && !mNoAnimationsInThisFrame;
         }
         iconState.iconAppearAmount = !USE_ANIMATIONS_WHEN_OPENING
                     || iconState.useFullTransitionAmount
@@ -503,6 +506,8 @@ public class NotificationShelf extends ActivatableNotificationView implements
     }
 
     private void setOpenedAmount(float openedAmount) {
+        mNoAnimationsInThisFrame = openedAmount == 1.0f && mOpenedAmount == 0.0f;
+        mOpenedAmount = openedAmount;
         if (!mAmbientState.isPanelFullWidth()) {
             // We don't do a transformation at all, lets just assume we are fully opened
             openedAmount = 1.0f;