OSDN Git Service

Fixed an icon flickering when adding a notification
authorSelim Cinek <cinek@google.com>
Wed, 28 Jun 2017 13:44:02 +0000 (15:44 +0200)
committerSelim Cinek <cinek@google.com>
Wed, 28 Jun 2017 13:44:02 +0000 (15:44 +0200)
If an added notification was overlapping with the shelf,
it's icon would flicker.

Test: manual, add notification on bottom, observe icons
Change-Id: Iddbb2402a3595ff62594f77582725e87f7a67bfd
Fixes: 62600772

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

index eec818b..29b720c 100644 (file)
@@ -943,6 +943,10 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
         }
     }
 
+    public boolean isDrawingAppearAnimation() {
+        return mDrawingAppearAnimation;
+    }
+
     @Override
     protected void dispatchDraw(Canvas canvas) {
         if (mDrawingAppearAnimation) {
index 97e2f6d..1e72b89 100644 (file)
@@ -452,6 +452,11 @@ public class NotificationShelf extends ActivatableNotificationView implements
             iconState.scaleX = newSize / icon.getHeight() / icon.getIconScale();
             iconState.scaleY = iconState.scaleX;
             iconState.hidden = transitionAmount == 0.0f && !iconState.isAnimating(icon);
+            boolean isAppearing = row.isDrawingAppearAnimation() && !row.isInShelf();
+            if (isAppearing) {
+                iconState.hidden = true;
+                iconState.iconAppearAmount = 0.0f;
+            }
             iconState.alpha = alpha;
             iconState.yTranslation = iconYTranslation;
             if (stayingInShelf) {