Merge "Ensure smart replies are always visible" into sc-v2-dev am: 96d821aa4e am: 6af2254203

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16360549

Change-Id: Ie02214a34f18411b37e51a18da5617d63d05f9cd
This commit is contained in:
TreeHugger Robot
2021-11-30 13:41:32 +00:00
committed by Automerger Merge Worker

View File

@@ -219,6 +219,7 @@ public class SmartReplyView extends ViewGroup {
private void clearLayoutLineCount(View view) {
if (view instanceof TextView) {
((TextView) view).nullLayouts();
view.forceLayout();
}
}
@@ -271,6 +272,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);
@@ -604,6 +608,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();