From 88323dfae8b4c5f2e2b4a7597b295d3a59036656 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Thu, 24 Jun 2021 12:42:16 +0200 Subject: [PATCH] Fixed an issue where notifications wouldn't animate on height change When switching between templates, the old intrinsic height was 0 before the layout, which suppressed the height animation. We're now also animating if the previous height was 0 but the view already had a height. Fixes: 187979400 Test: add gmail notification, archive, observe animation Change-Id: I3fa2edf9a39b586a685a96f89a74ead597143981 --- .../statusbar/notification/row/ExpandableNotificationRow.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java index 76f9fe728f2f9..93166f39ad62a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java @@ -2482,7 +2482,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView protected void onLayout(boolean changed, int left, int top, int right, int bottom) { int intrinsicBefore = getIntrinsicHeight(); super.onLayout(changed, left, top, right, bottom); - if (intrinsicBefore != getIntrinsicHeight() && intrinsicBefore != 0) { + if (intrinsicBefore != getIntrinsicHeight() + && (intrinsicBefore != 0 || getActualHeight() > 0)) { notifyHeightChanged(true /* needsAnimation */); } if (mMenuRow != null && mMenuRow.getMenuView() != null) {