Merge "Ensure smart replies are always visible" into sc-v2-dev am: 96d821aa4e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16360549 Change-Id: I03e1fa32318dc2e404962b504f37d2e7092ddc78
This commit is contained in:
@@ -219,6 +219,7 @@ public class SmartReplyView extends ViewGroup {
|
|||||||
private void clearLayoutLineCount(View view) {
|
private void clearLayoutLineCount(View view) {
|
||||||
if (view instanceof TextView) {
|
if (view instanceof TextView) {
|
||||||
((TextView) view).nullLayouts();
|
((TextView) view).nullLayouts();
|
||||||
|
view.forceLayout();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -270,6 +271,9 @@ public class SmartReplyView extends ViewGroup {
|
|||||||
|
|
||||||
clearLayoutLineCount(child);
|
clearLayoutLineCount(child);
|
||||||
child.measure(MEASURE_SPEC_ANY_LENGTH, heightMeasureSpec);
|
child.measure(MEASURE_SPEC_ANY_LENGTH, heightMeasureSpec);
|
||||||
|
if (((Button) child).getLayout() == null) {
|
||||||
|
Log.wtf(TAG, "Button layout is null after measure.");
|
||||||
|
}
|
||||||
|
|
||||||
coveredSuggestions.add(child);
|
coveredSuggestions.add(child);
|
||||||
|
|
||||||
@@ -590,6 +594,9 @@ public class SmartReplyView extends ViewGroup {
|
|||||||
button.getPaddingLeft() + button.getPaddingRight() + textWidth
|
button.getPaddingLeft() + button.getPaddingRight() + textWidth
|
||||||
+ getLeftCompoundDrawableWidthWithPadding(button), MeasureSpec.AT_MOST);
|
+ getLeftCompoundDrawableWidthWithPadding(button), MeasureSpec.AT_MOST);
|
||||||
button.measure(widthMeasureSpec, heightMeasureSpec);
|
button.measure(widthMeasureSpec, heightMeasureSpec);
|
||||||
|
if (button.getLayout() == null) {
|
||||||
|
Log.wtf(TAG, "Button layout is null after measure.");
|
||||||
|
}
|
||||||
|
|
||||||
final int newWidth = button.getMeasuredWidth();
|
final int newWidth = button.getMeasuredWidth();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user