From bb42b7dd4892a8ab99f2f702cad931235d1d463e Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Wed, 10 Aug 2016 13:02:38 -0700 Subject: [PATCH] Avoid weird expand animation when a notification is updated Whenever a notification was updated and it was expanded, the animation would look incredibly weird. This is now fixed. Change-Id: Iaeac6f71c3771c4782e751be50b54b62d08b643e Fixes: 30693397 --- .../systemui/statusbar/ExpandableNotificationRow.java | 8 +++----- .../statusbar/stack/NotificationStackScrollLayout.java | 8 -------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java index 58d402bb74327..8e86ae001238f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java @@ -507,7 +507,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { int intrinsicHeight = getIntrinsicHeight(); mIsPinned = pinned; if (intrinsicHeight != getIntrinsicHeight()) { - notifyHeightChanged(false); + notifyHeightChanged(false /* needsAnimation */); } if (pinned) { setIconAnimationRunning(true); @@ -840,8 +840,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { } public void resetHeight() { - mMaxExpandHeight = 0; - mHeadsUpHeight = 0; onHeightReset(); requestLayout(); } @@ -1290,7 +1288,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { } mHeadsUpHeight = headsUpChild.getHeight(); if (intrinsicBefore != getIntrinsicHeight()) { - notifyHeightChanged(false /* needsAnimation */); + notifyHeightChanged(true /* needsAnimation */); } } @@ -1398,7 +1396,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { if (isChildInGroup()) { mGroupManager.setGroupExpanded(mStatusBarNotification, true); } - notifyHeightChanged(false); + notifyHeightChanged(false /* needsAnimation */); } public void setChildrenExpanded(boolean expanded, boolean animate) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java index f72e50beec108..3d25778211d74 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -216,7 +216,6 @@ public class NotificationStackScrollLayout extends ViewGroup private float mTopPaddingOverflow; private boolean mDontReportNextOverScroll; private boolean mDontClampNextScroll; - private boolean mRequestViewResizeAnimationOnLayout; private boolean mNeedViewResizeAnimation; private View mExpandedGroupView; private boolean mEverythingNeedsAnimation; @@ -515,10 +514,6 @@ public class NotificationStackScrollLayout extends ViewGroup setMaxLayoutHeight(getHeight()); updateContentHeight(); clampScrollPosition(); - if (mRequestViewResizeAnimationOnLayout) { - requestAnimationOnViewResize(null); - mRequestViewResizeAnimationOnLayout = false; - } requestChildrenUpdate(); updateFirstAndLastBackgroundViews(); } @@ -3100,9 +3095,6 @@ public class NotificationStackScrollLayout extends ViewGroup @Override public void onReset(ExpandableView view) { - if (mIsExpanded && mAnimationsEnabled) { - mRequestViewResizeAnimationOnLayout = true; - } updateAnimationState(view); updateChronometerForChild(view); }