Commit bf26bd10 authored by Clemens Arbesser's avatar Clemens Arbesser Committed by Commit Bot

[Autofill Assistant] Backend changes to the autofill assistant payment request...

[Autofill Assistant] Backend changes to the autofill assistant payment request in order to support collapsing PR sections.

This fixes a bug that prevented using expand(null) to collapse all PR sections.

Bug: 806868
Change-Id: Ia67b2c7fb778d05356927524ddbcd5c93a5ffa22
Reviewed-on: https://chromium-review.googlesource.com/c/1337330Reviewed-by: default avatarMathias Carlen <mcarlen@chromium.org>
Commit-Queue: Clemens Arbesser <arbesser@google.com>
Cr-Commit-Position: refs/heads/master@{#609244}
parent 84b396de
...@@ -717,7 +717,7 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View ...@@ -717,7 +717,7 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
} }
private void expand(PaymentRequestSection section) { private void expand(PaymentRequestSection section) {
if (!mIsExpandedToFullHeight) { if (!mIsExpandedToFullHeight && section != null) {
// Container now takes the full height of the screen, animating towards it. // Container now takes the full height of the screen, animating towards it.
mRequestView.getLayoutParams().height = LayoutParams.MATCH_PARENT; mRequestView.getLayoutParams().height = LayoutParams.MATCH_PARENT;
mRequestView.addOnLayoutChangeListener(new SheetEnlargingAnimator(true)); mRequestView.addOnLayoutChangeListener(new SheetEnlargingAnimator(true));
...@@ -733,12 +733,11 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View ...@@ -733,12 +733,11 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
// Disable all but the first button. // Disable all but the first button.
updateSectionButtons(); updateSectionButtons();
mIsExpandedToFullHeight = true;
} }
// Update the section contents when they're selected. // Update the section contents when they're selected.
mSelectedSection = section; mSelectedSection = section;
mIsExpandedToFullHeight = mSelectedSection != null;
if (mSelectedSection == mOrderSummarySection) { if (mSelectedSection == mOrderSummarySection) {
mClient.getShoppingCart(new Callback<ShoppingCart>() { mClient.getShoppingCart(new Callback<ShoppingCart>() {
@Override @Override
......
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