Search in sources :

Example 1 with AutofillSuggestion

use of org.chromium.components.autofill.AutofillSuggestion in project AndroidChromium by JackyAndroid.

the class AutofillKeyboardAccessoryBridge method addToAutofillSuggestionArray.

/**
     * @param array AutofillSuggestion array that should get a new suggestion added.
     * @param index Index in the array where to place a new suggestion.
     * @param label Suggested text. The text that's going to be filled in the focused field, with a
     *              few exceptions:
     *              <ul>
     *                  <li>Credit card numbers are elided, e.g. "Visa ****-1234."</li>
     *                  <li>The text "CLEAR FORM" will clear the filled in text.</li>
     *                  <li>Empty text can be used to display only icons, e.g. for credit card scan
     *                      or editing autofill settings.</li>
     *              </ul>
     * @param sublabel Hint for the suggested text. The text that's going to be filled in the
     *                 unfocused fields of the form. If {@see label} is empty, then this must be
     *                 empty too.
     * @param iconId The resource ID for the icon associated with the suggestion, or 0 for no icon.
     * @param suggestionId Identifier for the suggestion type.
     */
@CalledByNative
private static void addToAutofillSuggestionArray(AutofillSuggestion[] array, int index, String label, String sublabel, int iconId, int suggestionId, boolean deletable) {
    int drawableId = iconId == 0 ? DropdownItem.NO_ICON : ResourceId.mapToDrawableId(iconId);
    array[index] = new AutofillSuggestion(label, sublabel, drawableId, suggestionId, deletable, false);
}
Also used : AutofillSuggestion(org.chromium.components.autofill.AutofillSuggestion) CalledByNative(org.chromium.base.annotations.CalledByNative)

Example 2 with AutofillSuggestion

use of org.chromium.components.autofill.AutofillSuggestion in project AndroidChromium by JackyAndroid.

the class AutofillPopupBridge method addToAutofillSuggestionArray.

/**
     * @param array AutofillSuggestion array that should get a new suggestion added.
     * @param index Index in the array where to place a new suggestion.
     * @param label First line of the suggestion.
     * @param sublabel Second line of the suggestion.
     * @param iconId The resource ID for the icon associated with the suggestion, or 0 for no icon.
     * @param suggestionId Identifier for the suggestion type.
     * @param deletable Whether this item is deletable.
     * @param isLabelMultiline Whether the label should be should over multiple lines.
     */
@CalledByNative
private static void addToAutofillSuggestionArray(AutofillSuggestion[] array, int index, String label, String sublabel, int iconId, int suggestionId, boolean deletable, boolean isLabelMultiline) {
    int drawableId = iconId == 0 ? DropdownItem.NO_ICON : ResourceId.mapToDrawableId(iconId);
    array[index] = new AutofillSuggestion(label, sublabel, drawableId, suggestionId, deletable, isLabelMultiline);
}
Also used : AutofillSuggestion(org.chromium.components.autofill.AutofillSuggestion) CalledByNative(org.chromium.base.annotations.CalledByNative)

Aggregations

CalledByNative (org.chromium.base.annotations.CalledByNative)2 AutofillSuggestion (org.chromium.components.autofill.AutofillSuggestion)2