summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2021-11-30 13:18:53 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2021-11-30 13:18:53 +0000
commit96d821aa4e04b7003ff518a7beb04cae77c7ceea (patch)
tree3ae1e0615689ffab5ffe83d2d67607f566aa2893
parent504e256c43e4db34cdeb3afd4f40aae22e13bcf1 (diff)
parente0d848ed9128df017ebf725cb3207df9edd3497c (diff)
Merge "Ensure smart replies are always visible" into sc-v2-dev
-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();