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

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: Fixes compile error. 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..3a5bd066ed320f6931599a82835818eb984342f9 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
@@ -6,6 +6,7 @@ package org.chromium.components.autofill;
import android.annotation.SuppressLint;
import android.content.Context;
+import android.graphics.Color;
import android.view.View;
import android.widget.AdapterView;
import android.widget.PopupWindow;
@@ -28,7 +29,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
+ * components/autofill/core/browser/popup_item_ids.h
*/
private static final int ITEM_ID_SEPARATOR_ENTRY = -3;
@@ -57,9 +59,18 @@ 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 {@code Color.TRANSPARENT} if unspecified.
+ * @param dividerColor color for divider between popup items, or {@code Color.TRANSPARENT} 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,
+ * 0 if unspecified.
*/
@SuppressLint("InlinedApi")
- public void filterAndShow(AutofillSuggestion[] suggestions, boolean isRtl) {
+ public void filterAndShow(AutofillSuggestion[] suggestions, boolean isRtl,
+ int backgroundColor, int dividerColor, int dropdownItemHeight) {
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,10 @@ public class AutofillPopup extends DropdownPopupWindow implements AdapterView.On
}
}
- setAdapter(new DropdownAdapter(mContext, cleanedData, separators));
+ setAdapter(new DropdownAdapter(mContext, cleanedData, separators,
+ backgroundColor == Color.TRANSPARENT ? null : backgroundColor,
+ dividerColor == Color.TRANSPARENT ? null : dividerColor,
+ dropdownItemHeight == 0 ? null : dropdownItemHeight));
setRtl(isRtl);
show();
getListView().setOnItemLongClickListener(this);

Powered by Google App Engine
This is Rietveld 408576698