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
This commit is contained in:
Selim Cinek
2017-02-03 12:34:16 -08:00
parent 56f542f249
commit edebced70f

View File

@@ -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;