| 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);
|
|
|