Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD and TYPE_TEXT_VARIATION_PASSWORD

Tags:

android

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)

like image 606
Byte Welder Avatar asked Sep 26 '22 19:09

Byte Welder


1 Answers

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.

like image 174
ρяσѕρєя K Avatar answered Sep 30 '22 06:09

ρяσѕρєя K