From f38d6c3b158c9e03c4264f12fab9be0cbb05564b Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Wed, 28 Jun 2017 15:44:02 +0200 Subject: [PATCH] Fixed an icon flickering when adding a notification 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 --- .../com/android/systemui/statusbar/ActivatableNotificationView.java | 4 ++++ .../src/com/android/systemui/statusbar/NotificationShelf.java | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java b/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java index eec818b2c9b3..29b720cdcd88 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java @@ -943,6 +943,10 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView } } + public boolean isDrawingAppearAnimation() { + return mDrawingAppearAnimation; + } + @Override protected void dispatchDraw(Canvas canvas) { if (mDrawingAppearAnimation) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java index 97e2f6d3e6f1..1e72b893b975 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java @@ -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) { -- 2.11.0