From e0d848ed9128df017ebf725cb3207df9edd3497c Mon Sep 17 00:00:00 2001 From: Jeff DeCew Date: Tue, 30 Nov 2021 02:30:43 +0000 Subject: [PATCH] Ensure smart replies are always visible Fixes: 205657774 Test: post notification with smart replies, rotate with shade closed, open shade Change-Id: I2a527aa9d91ddb6008447bb2a72433031bed782e --- .../android/systemui/statusbar/policy/SmartReplyView.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java index 85add6c21b72d..aec9db5c2de24 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java @@ -219,6 +219,7 @@ public class SmartReplyView extends ViewGroup { private void clearLayoutLineCount(View view) { if (view instanceof TextView) { ((TextView) view).nullLayouts(); + view.forceLayout(); } } @@ -270,6 +271,9 @@ public class SmartReplyView extends ViewGroup { clearLayoutLineCount(child); child.measure(MEASURE_SPEC_ANY_LENGTH, heightMeasureSpec); + if (((Button) child).getLayout() == null) { + Log.wtf(TAG, "Button layout is null after measure."); + } coveredSuggestions.add(child); @@ -590,6 +594,9 @@ public class SmartReplyView extends ViewGroup { button.getPaddingLeft() + button.getPaddingRight() + textWidth + getLeftCompoundDrawableWidthWithPadding(button), MeasureSpec.AT_MOST); button.measure(widthMeasureSpec, heightMeasureSpec); + if (button.getLayout() == null) { + Log.wtf(TAG, "Button layout is null after measure."); + } final int newWidth = button.getMeasuredWidth();