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

Unified Diff: components/autofill/android/java/src/org/chromium/components/autofill/AutofillPopup.java

Issue 2531223003: Expanded Autofill Credit Card Popup Layout Experiment in Android. (Closed)
Patch Set: Uses format string for expiration date label. Consistently returns 0 as default (non-experiment) va… Created 4 years 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
Index: components/autofill/android/java/src/org/chromium/components/autofill/AutofillPopup.java
diff --git a/components/autofill/android/java/src/org/chromium/components/autofill/AutofillPopup.java b/components/autofill/android/java/src/org/chromium/components/autofill/AutofillPopup.java
index 55c214f2af9dc251126b3f4352e04791ba5272f2..3a9befaa86e8be6f6f5154e1fb82020a1a3b8edc 100644
--- a/components/autofill/android/java/src/org/chromium/components/autofill/AutofillPopup.java
+++ b/components/autofill/android/java/src/org/chromium/components/autofill/AutofillPopup.java
@@ -28,7 +28,8 @@ public class AutofillPopup extends DropdownPopupWindow implements AdapterView.On
/**
* The constant used to specify a separator in a list of Autofill suggestions.
- * Has to be kept in sync with enum in WebAutofillClient.h
+ * Has to be kept in sync with {@code POPUP_ITEM_ID_SEPARATOR} enum in
Mathieu 2016/12/01 21:59:47 Add a similar TODO to https://cs.chromium.org/chro
csashi 2016/12/02 05:15:29 Done.
+ * components/autofill/core/browser/popup_item_ids.h
*/
private static final int ITEM_ID_SEPARATOR_ENTRY = -3;
@@ -57,9 +58,19 @@ public class AutofillPopup extends DropdownPopupWindow implements AdapterView.On
/**
* Filters the Autofill suggestions to the ones that we support and shows the popup.
* @param suggestions Autofill suggestion data.
+ * @param isRtl @code true if right-to-left text.
+ * @param backgroundColor popup background color, or 0 if unspecified.
+ * @param dividerColor color for divider between popup items, or 0 if unspecified.
+ * @param isBoldLabel true if suggestion label's type face is {@code Typeface.BOLD}, false if
+ * suggestion label's type face is {@code Typeface.NORMAL}.
+ * @param dropdownItemHeight height of each dropdown item in dimension independent pixel units,
+ * -1 if unspecified.
+ * @param isIconAtLeft @code true if suggestion icon, |mIconId| must be displayed to left of
+ * |mLabel| and |mSublabel| suggestion text.
*/
@SuppressLint("InlinedApi")
- public void filterAndShow(AutofillSuggestion[] suggestions, boolean isRtl) {
+ public void filterAndShow(AutofillSuggestion[] suggestions, boolean isRtl,
+ int backgroundColor, int dividerColor, int dropdownItemHeight, boolean isIconAtLeft) {
mSuggestions = new ArrayList<AutofillSuggestion>(Arrays.asList(suggestions));
// Remove the AutofillSuggestions with IDs that are not supported by Android
ArrayList<DropdownItem> cleanedData = new ArrayList<DropdownItem>();
@@ -73,7 +84,8 @@ public class AutofillPopup extends DropdownPopupWindow implements AdapterView.On
}
}
- setAdapter(new DropdownAdapter(mContext, cleanedData, separators));
+ setAdapter(new DropdownAdapter(mContext, cleanedData, separators, backgroundColor,
+ dividerColor, dropdownItemHeight, isIconAtLeft));
setRtl(isRtl);
show();
getListView().setOnItemLongClickListener(this);

Powered by Google App Engine
This is Rietveld 408576698