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
This commit is contained in:
Selim Cinek
2017-06-28 15:44:02 +02:00
parent d43bc31eb7
commit f38d6c3b15
2 changed files with 9 additions and 0 deletions

View File

@@ -943,6 +943,10 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
}
}
public boolean isDrawingAppearAnimation() {
return mDrawingAppearAnimation;
}
@Override
protected void dispatchDraw(Canvas canvas) {
if (mDrawingAppearAnimation) {

View 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) {