Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1590)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillCreditCardEditor.java

Issue 2101813002: Enable [Save] button after changing billing address. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillCreditCardEditor.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillCreditCardEditor.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillCreditCardEditor.java
index 41462798b48862d083c9ac1ad79b339cbba4c22b..ae2e59d3554dfca85117df4952e881a964d4c361 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillCreditCardEditor.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillCreditCardEditor.java
@@ -42,6 +42,7 @@ public class AutofillCreditCardEditor extends AutofillEditorBase {
private int mInitialExpirationMonthPos;
private int mInitialExpirationYearPos;
+ private int mInitialBillingAddressPos;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
@@ -81,7 +82,8 @@ public class AutofillCreditCardEditor extends AutofillEditorBase {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if ((parent == mExpirationYear && position != mInitialExpirationYearPos)
- || (parent == mExpirationMonth && position != mInitialExpirationMonthPos)) {
+ || (parent == mExpirationMonth && position != mInitialExpirationMonthPos)
+ || (parent == mBillingAddress && position != mInitialBillingAddressPos)) {
updateSaveButtonEnabled();
}
}
@@ -134,6 +136,7 @@ public class AutofillCreditCardEditor extends AutofillEditorBase {
}
mBillingAddress.setAdapter(profilesAdapter);
+ mInitialBillingAddressPos = 0;
mBillingAddress.setSelection(0);
// TODO(rouslan): Use an [+ ADD ADDRESS] button instead of disabling the dropdown.
@@ -188,6 +191,7 @@ public class AutofillCreditCardEditor extends AutofillEditorBase {
for (int i = 0; i < mBillingAddress.getAdapter().getCount(); i++) {
AutofillProfile profile = (AutofillProfile) mBillingAddress.getAdapter().getItem(i);
if (TextUtils.equals(profile.getGUID(), card.getBillingAddressId())) {
+ mInitialBillingAddressPos = i;
mBillingAddress.setSelection(i);
break;
}
@@ -228,6 +232,7 @@ public class AutofillCreditCardEditor extends AutofillEditorBase {
mNumberText.addTextChangedListener(this);
mExpirationMonth.setOnItemSelectedListener(this);
mExpirationYear.setOnItemSelectedListener(this);
+ mBillingAddress.setOnItemSelectedListener(this);
}
private void updateSaveButtonEnabled() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698