Commit 9624455d authored by gogerald's avatar gogerald Committed by Commit bot

Fix janky behavior in attribution text in PR UI

BUG=676090

Review-Url: https://codereview.chromium.org/2618783002
Cr-Commit-Position: refs/heads/master@{#441741}
parent 23142d0b
...@@ -1079,14 +1079,13 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View ...@@ -1079,14 +1079,13 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
view.setMovementMethod(LinkMovementMethod.getInstance()); view.setMovementMethod(LinkMovementMethod.getInstance());
ApiCompatibilityUtils.setTextAppearance(view, R.style.PaymentsUiSectionDescriptiveText); ApiCompatibilityUtils.setTextAppearance(view, R.style.PaymentsUiSectionDescriptiveText);
LinearLayout.LayoutParams layoutParams = // Add paddings instead of margin to let getMeasuredHeight return correct value for section
new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); // resize animation.
int marginSize = mContext.getResources().getDimensionPixelSize( int paddingSize = mContext.getResources().getDimensionPixelSize(
R.dimen.payments_section_large_spacing); R.dimen.payments_section_large_spacing);
layoutParams.topMargin = marginSize; ApiCompatibilityUtils.setPaddingRelative(
ApiCompatibilityUtils.setMarginStart(layoutParams, marginSize); view, paddingSize, paddingSize, paddingSize, paddingSize);
ApiCompatibilityUtils.setMarginEnd(layoutParams, marginSize); parent.addView(view);
parent.addView(view, layoutParams);
} }
private Callback<SectionInformation> createUpdateSectionCallback(@DataType final int type) { private Callback<SectionInformation> createUpdateSectionCallback(@DataType final int type) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment