How do you know whether to use
android.text.InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD
or android.text.InputType.TYPE_TEXT_VARIATION_PASSWORD
?
The documentation of TYPE_TEXT_VARIATION_WEB_PASSWORD
:
Variation of TYPE_CLASS_TEXT: entering password inside of a web form. This was added in HONEYCOMB. An IME must target this API version or later to see this input type; if it doesn't, a request for this type will be seen as TYPE_TEXT_VARIATION_PASSWORD when passed through EditorInfo.makeCompatible(int).
The documentation of TYPE_TEXT_VARIATION_PASSWORD
:
Variation of TYPE_CLASS_TEXT: entering a password.
In which case is a form considered a "web form"? Is there any difference in behavior between the two? (visually and/or logically)
In which case is a form considered a "web form"?
If EditText( html input field) is inside browser page( any web form which takes input from user).
We need to use InputType TYPE_TEXT_VARIATION_WEB_PASSWORD
in case of web-from.
if EditText is object of EditText in native application then need to use TYPE_TEXT_VARIATION_PASSWORD
Is there any difference in behaviour between the two? (visually and/or logically)
YES,
See com.android.inputmethod.latin.InputAttributes here:
TYPE_TEXT_VARIATION_WEB_EDIT_TEXT
flag is used :
// If it's a browser edit field and auto correct is not ON explicitly, then
// disable auto correction, but keep suggestions on.
// If NO_SUGGESTIONS is set, don't do prediction.
// If it's not multiline and the autoCorrect flag is not set, then don't correct
But in case of TYPE_TEXT_VARIATION_PASSWORD
InputType above comments are not TRUE.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With