From edebced70f7d8880db37c9e5bce818f08b4d62f3 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Fri, 3 Feb 2017 12:34:16 -0800 Subject: [PATCH] Fixed a quick flash of the icon when adding a notification The add animation shouldn't run if the icon isn't visible. Test: Add notification while shade open, observe icon closely Fixes: 34502403 Change-Id: I086b7baef5983052af9682e4008fe3d360df6a36 --- .../statusbar/phone/NotificationIconContainer.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconContainer.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconContainer.java index 4c18512059a28..dacd6d54bf239 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconContainer.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconContainer.java @@ -440,10 +440,12 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout { AnimationProperties animationProperties = null; if (justAdded) { super.applyToView(icon); - icon.setAlpha(0.0f); - icon.setVisibleState(StatusBarIconView.STATE_HIDDEN, false /* animate */); - animationProperties = ADD_ICON_PROPERTIES; - animate = true; + if (iconAppearAmount != 0.0f) { + icon.setAlpha(0.0f); + icon.setVisibleState(StatusBarIconView.STATE_HIDDEN, false /* animate */); + animationProperties = ADD_ICON_PROPERTIES; + animate = true; + } } else if (visibleState != icon.getVisibleState()) { animationProperties = DOT_ANIMATION_PROPERTIES; animate = true;