summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jeff DeCew <jeffdq@google.com> 2021-11-30 02:30:43 +0000
committer Jeff DeCew <jeffdq@google.com> 2021-11-30 02:32:10 +0000
commite0d848ed9128df017ebf725cb3207df9edd3497c (patch)
treeec7a2c1b33f3324195498c1f5a400ccd1b0b15cd
parentcf9560a43b31f1762c4c73cc5d763e73515cd944 (diff)
Ensure smart replies are always visible
Fixes: 205657774 Test: post notification with smart replies, rotate with shade closed, open shade Change-Id: I2a527aa9d91ddb6008447bb2a72433031bed782e
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java7
1 files changed, 7 insertions, 0 deletions
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 85add6c21b72..aec9db5c2de2 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();