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 // Display selected shipping option name in the left summary text view a
nd |
| 547 // the cost in the right summary text view on bottom sheet. |
| 548 mShippingOptionSection.setSplitSummaryInDisplayModeNormal(true); |
| 549 |
546 // Some sections conditionally allow adding new options. | 550 // Some sections conditionally allow adding new options. |
547 mShippingOptionSection.setCanAddItems(false); | 551 mShippingOptionSection.setCanAddItems(false); |
548 mPaymentMethodSection.setCanAddItems(canAddCards); | 552 mPaymentMethodSection.setCanAddItems(canAddCards); |
549 | 553 |
550 // Add the necessary sections to the layout. | 554 // Add the necessary sections to the layout. |
551 mPaymentContainerLayout.addView(mOrderSummarySection, new LinearLayout.L
ayoutParams( | 555 mPaymentContainerLayout.addView(mOrderSummarySection, new LinearLayout.L
ayoutParams( |
552 LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); | 556 LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); |
553 mSectionSeparators.add(new SectionSeparator(mPaymentContainerLayout)); | 557 mSectionSeparators.add(new SectionSeparator(mPaymentContainerLayout)); |
554 if (mRequestShipping) { | 558 if (mRequestShipping) { |
555 // The shipping breakout sections are only added if they are needed. | 559 // 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); | 1359 sObserverForTest.onPaymentRequestReadyForInput(this); |
1356 } | 1360 } |
1357 } | 1361 } |
1358 | 1362 |
1359 private void notifySelectionChecked() { | 1363 private void notifySelectionChecked() { |
1360 if (sObserverForTest != null) { | 1364 if (sObserverForTest != null) { |
1361 sObserverForTest.onPaymentRequestSelectionChecked(this); | 1365 sObserverForTest.onPaymentRequestSelectionChecked(this); |
1362 } | 1366 } |
1363 } | 1367 } |
1364 } | 1368 } |
OLD | NEW |