From 9171207bf5d70d7af647fa0ee135140cac3a3cc1 Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Thu, 8 Aug 2019 15:27:53 -0700 Subject: [PATCH] Do not set guts visibility to transient state We can't really copy the guts visibility during reinflation because we might be in the middle of an animation. Let's rely on a more stable property to determine the visibility. Test: expand guts, close guts Test: expand guts, switch dark mode Test: expand guts, switch dark mode, expand guts again Test: change font size, expand and collapse guts Fixes: 135553192 Change-Id: I76f02bbd8f071c94e9c2c777e1d1c1de995ea37b --- .../statusbar/notification/row/ExpandableNotificationRow.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 ea31be4cf90ca..d6aeb4ff2c23d 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 @@ -1209,12 +1209,12 @@ public class ExpandableNotificationRow extends ActivatableNotificationView mChildrenContainer.reInflateViews(mExpandClickListener, mEntry.notification); } if (mGuts != null) { - View oldGuts = mGuts; + NotificationGuts oldGuts = mGuts; int index = indexOfChild(oldGuts); removeView(oldGuts); mGuts = (NotificationGuts) LayoutInflater.from(mContext).inflate( R.layout.notification_guts, this, false); - mGuts.setVisibility(oldGuts.getVisibility()); + mGuts.setVisibility(oldGuts.isExposed() ? VISIBLE : GONE); addView(mGuts, index); } View oldMenu = mMenuRow == null ? null : mMenuRow.getMenuView();