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 android.animation.Animator; | 7 import android.animation.Animator; |
8 import android.animation.AnimatorListenerAdapter; | 8 import android.animation.AnimatorListenerAdapter; |
9 import android.animation.AnimatorSet; | 9 import android.animation.AnimatorSet; |
10 import android.animation.ObjectAnimator; | 10 import android.animation.ObjectAnimator; |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 import org.chromium.base.ApiCompatibilityUtils; | 38 import org.chromium.base.ApiCompatibilityUtils; |
39 import org.chromium.base.VisibleForTesting; | 39 import org.chromium.base.VisibleForTesting; |
40 import org.chromium.chrome.R; | 40 import org.chromium.chrome.R; |
41 import org.chromium.chrome.browser.autofill.PhoneNumberUtil; | 41 import org.chromium.chrome.browser.autofill.PhoneNumberUtil; |
42 import org.chromium.chrome.browser.customtabs.CustomTabActivity; | 42 import org.chromium.chrome.browser.customtabs.CustomTabActivity; |
43 import org.chromium.chrome.browser.payments.ui.PaymentRequestUI.PaymentRequestOb
serverForTest; | 43 import org.chromium.chrome.browser.payments.ui.PaymentRequestUI.PaymentRequestOb
serverForTest; |
44 import org.chromium.chrome.browser.preferences.autofill.CreditCardNumberFormatti
ngTextWatcher; | 44 import org.chromium.chrome.browser.preferences.autofill.CreditCardNumberFormatti
ngTextWatcher; |
45 import org.chromium.chrome.browser.widget.AlwaysDismissedDialog; | 45 import org.chromium.chrome.browser.widget.AlwaysDismissedDialog; |
46 import org.chromium.chrome.browser.widget.DualControlLayout; | 46 import org.chromium.chrome.browser.widget.DualControlLayout; |
| 47 import org.chromium.chrome.browser.widget.FadingEdgeScrollView; |
47 import org.chromium.chrome.browser.widget.FadingShadow; | 48 import org.chromium.chrome.browser.widget.FadingShadow; |
48 import org.chromium.chrome.browser.widget.FadingShadowView; | 49 import org.chromium.chrome.browser.widget.FadingShadowView; |
49 import org.chromium.ui.UiUtils; | 50 import org.chromium.ui.UiUtils; |
50 | 51 |
51 import java.util.ArrayList; | 52 import java.util.ArrayList; |
52 import java.util.List; | 53 import java.util.List; |
53 import java.util.regex.Pattern; | 54 import java.util.regex.Pattern; |
54 | 55 |
55 import javax.annotation.Nullable; | 56 import javax.annotation.Nullable; |
56 | 57 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 }); | 191 }); |
191 | 192 |
192 // Make it appear that the toolbar is floating by adding a shadow. | 193 // Make it appear that the toolbar is floating by adding a shadow. |
193 FadingShadowView shadow = (FadingShadowView) mLayout.findViewById(R.id.s
hadow); | 194 FadingShadowView shadow = (FadingShadowView) mLayout.findViewById(R.id.s
hadow); |
194 shadow.init(ApiCompatibilityUtils.getColor(mContext.getResources(), | 195 shadow.init(ApiCompatibilityUtils.getColor(mContext.getResources(), |
195 R.color.toolbar_shadow_color), FadingShadow.POSITION_TOP); | 196 R.color.toolbar_shadow_color), FadingShadow.POSITION_TOP); |
196 | 197 |
197 // The top shadow is handled by the toolbar, so hide the one used in the
field editor. | 198 // The top shadow is handled by the toolbar, so hide the one used in the
field editor. |
198 FadingEdgeScrollView scrollView = | 199 FadingEdgeScrollView scrollView = |
199 (FadingEdgeScrollView) mLayout.findViewById(R.id.scroll_view); | 200 (FadingEdgeScrollView) mLayout.findViewById(R.id.scroll_view); |
200 scrollView.setShadowVisibility(false, true); | 201 scrollView.setEdgeVisibility( |
| 202 FadingEdgeScrollView.DRAW_NO_EDGE, FadingEdgeScrollView.DRAW_FAD
ING_EDGE); |
201 } | 203 } |
202 | 204 |
203 /** | 205 /** |
204 * Checks if all of the fields in the form are valid and updates the display
ed errors. If there | 206 * Checks if all of the fields in the form are valid and updates the display
ed errors. If there |
205 * are any invalid fields, makes sure that one of them is focused. Called wh
en user taps [SAVE]. | 207 * are any invalid fields, makes sure that one of them is focused. Called wh
en user taps [SAVE]. |
206 * | 208 * |
207 * @return Whether all fields contain valid information. | 209 * @return Whether all fields contain valid information. |
208 */ | 210 */ |
209 private boolean validateForm() { | 211 private boolean validateForm() { |
210 final List<EditorFieldView> invalidViews = getViewsWithInvalidInformatio
n(true); | 212 final List<EditorFieldView> invalidViews = getViewsWithInvalidInformatio
n(true); |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 public List<EditText> getEditableTextFieldsForTest() { | 542 public List<EditText> getEditableTextFieldsForTest() { |
541 return mEditableTextFields; | 543 return mEditableTextFields; |
542 } | 544 } |
543 | 545 |
544 /** @return All dropdown fields in the editor. Used only for tests. */ | 546 /** @return All dropdown fields in the editor. Used only for tests. */ |
545 @VisibleForTesting | 547 @VisibleForTesting |
546 public List<Spinner> getDropdownFieldsForTest() { | 548 public List<Spinner> getDropdownFieldsForTest() { |
547 return mDropdownFields; | 549 return mDropdownFields; |
548 } | 550 } |
549 } | 551 } |
OLD | NEW |