OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser.payments.ui; | 5 package org.chromium.chrome.browser.payments.ui; |
6 | 6 |
7 import static org.chromium.chrome.browser.payments.ui.PaymentRequestSection.EDIT _BUTTON_GONE; | 7 import static org.chromium.chrome.browser.payments.ui.PaymentRequestSection.EDIT _BUTTON_GONE; |
8 | 8 |
9 import android.animation.Animator; | 9 import android.animation.Animator; |
10 import android.animation.AnimatorListenerAdapter; | 10 import android.animation.AnimatorListenerAdapter; |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
536 mShippingOptionSection = new OptionSection( | 536 mShippingOptionSection = new OptionSection( |
537 context, context.getString(mShippingStrings.getOptionLabel()), t his); | 537 context, context.getString(mShippingStrings.getOptionLabel()), t his); |
538 mContactDetailsSection = new OptionSection( | 538 mContactDetailsSection = new OptionSection( |
539 context, context.getString(R.string.payments_contact_details_lab el), this); | 539 context, context.getString(R.string.payments_contact_details_lab el), this); |
540 mPaymentMethodSection = new OptionSection( | 540 mPaymentMethodSection = new OptionSection( |
541 context, context.getString(R.string.payments_method_of_payment_l abel), this); | 541 context, context.getString(R.string.payments_method_of_payment_l abel), this); |
542 | 542 |
543 // Display the summary of the selected address in multiple lines on bott om sheet. | 543 // Display the summary of the selected address in multiple lines on bott om sheet. |
544 mShippingAddressSection.setDisplaySummaryInSingleLineInNormalMode(false) ; | 544 mShippingAddressSection.setDisplaySummaryInSingleLineInNormalMode(false) ; |
545 | 545 |
546 // Align shipping option name to the left and cost to the right. | |
gogerald1
2017/05/31 20:34:47
suggest "//Lets the selected shipping option name
wuandy1
2017/06/01 17:17:57
Done.
| |
547 mShippingOptionSection.setSeparateMainAndSubLabelInNormalMode(true); | |
548 | |
546 // Some sections conditionally allow adding new options. | 549 // Some sections conditionally allow adding new options. |
547 mShippingOptionSection.setCanAddItems(false); | 550 mShippingOptionSection.setCanAddItems(false); |
548 mPaymentMethodSection.setCanAddItems(canAddCards); | 551 mPaymentMethodSection.setCanAddItems(canAddCards); |
549 | 552 |
550 // Add the necessary sections to the layout. | 553 // Add the necessary sections to the layout. |
551 mPaymentContainerLayout.addView(mOrderSummarySection, new LinearLayout.L ayoutParams( | 554 mPaymentContainerLayout.addView(mOrderSummarySection, new LinearLayout.L ayoutParams( |
552 LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); | 555 LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); |
553 mSectionSeparators.add(new SectionSeparator(mPaymentContainerLayout)); | 556 mSectionSeparators.add(new SectionSeparator(mPaymentContainerLayout)); |
554 if (mRequestShipping) { | 557 if (mRequestShipping) { |
555 // The shipping breakout sections are only added if they are needed. | 558 // The shipping breakout sections are only added if they are needed. |
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1355 sObserverForTest.onPaymentRequestReadyForInput(this); | 1358 sObserverForTest.onPaymentRequestReadyForInput(this); |
1356 } | 1359 } |
1357 } | 1360 } |
1358 | 1361 |
1359 private void notifySelectionChecked() { | 1362 private void notifySelectionChecked() { |
1360 if (sObserverForTest != null) { | 1363 if (sObserverForTest != null) { |
1361 sObserverForTest.onPaymentRequestSelectionChecked(this); | 1364 sObserverForTest.onPaymentRequestSelectionChecked(this); |
1362 } | 1365 } |
1363 } | 1366 } |
1364 } | 1367 } |
OLD | NEW |