Commit 705eec16 authored by Clemens Arbesser's avatar Clemens Arbesser Committed by Commit Bot

[Autofill Assistant] Fix double dividers in payment request.

This fixes a bug where the AA payment request would sometimes show two dividers between sections, resulting in a thicker divider than intended.

Before: https://screenshot.googleplex.com/WhYYQmeOTsX.png
After: https://screenshot.googleplex.com/noR3SYyy2ts.png

Bug: 806868
Change-Id: I94fc47d92c7f46a488d65c64f29e13e137b131d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1619790Reviewed-by: default avatarJordan Demeulenaere <jdemeulenaere@chromium.org>
Commit-Queue: Clemens Arbesser <arbesser@google.com>
Cr-Commit-Position: refs/heads/master@{#661338}
parent a979025a
......@@ -330,14 +330,15 @@ class AssistantPaymentRequestBinder
}
view.mTermsSection.setPaddings(view.mSectionToSectionPadding, 0);
// Hide the divider after the expanded section, if any.
boolean prevSectionIsExpanded = false;
// Hide dividers for currently invisible sections and after the expanded section, if any.
boolean prevSectionIsExpandedOrInvisible = false;
for (int i = 0; i < view.mPaymentRequestExpanderAccordion.getChildCount(); i++) {
View child = view.mPaymentRequestExpanderAccordion.getChildAt(i);
if (child instanceof AssistantVerticalExpander) {
prevSectionIsExpanded = ((AssistantVerticalExpander) child).isExpanded();
prevSectionIsExpandedOrInvisible = ((AssistantVerticalExpander) child).isExpanded()
|| child.getVisibility() != View.VISIBLE;
} else if (child.getTag() == view.mDividerTag) {
child.setVisibility(prevSectionIsExpanded ? View.GONE : View.VISIBLE);
child.setVisibility(prevSectionIsExpandedOrInvisible ? View.GONE : View.VISIBLE);
}
}
return true;
......
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