android-AutofillFramework icon indicating copy to clipboard operation
android-AutofillFramework copied to clipboard

Autofill hints values

Open kusan-reveur opened this issue 9 years ago • 3 comments

Hi,

Is it possible to get a list of values for the hints in the doc?

There is "username" and "password" in the exemple but is "mail" correct?

I guess it depends on the providers, but then it's not standardized? Removes a bit the point of the API then, no... ?

Thanks,

kusan-reveur avatar Sep 11 '17 16:09 kusan-reveur

You can find the constants on the reference doc for View. Look for variables named with the pattern "View.AUTOFILL_HINT_*". The "Constant value" is what you should put for the "autofillHints" attribute in your XML.

DougSig avatar Sep 11 '17 16:09 DougSig

Thanks! Would be good to put it in the doc (https://developer.android.com/guide/topics/text/autofill.html) and to use the View constant values in the exemple code instead of writing it bare.

kusan-reveur avatar Sep 12 '17 10:09 kusan-reveur

This is already documented on https://developer.android.com/guide/topics/text/autofill.html#providing_hints_for_autofill :

The Autofill Framework does not validate the hints; they are just passed along as is to the autofill service. Hence, they can have any value, but it is recommended to use predefined values such as AUTOFILL_HINT_USERNAME for a username or AUTOFILL_HINT_CREDIT_CARD_NUMBER for a credit card number. For a list of all predefined autofill hint constants, see the View reference.

the-felipeal avatar Sep 12 '17 17:09 the-felipeal