你怎么知道是否使用
android.text.InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD或android.text.InputType.TYPE_TEXT_VARIATION_PASSWORD?
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).
TYPE_TEXT_VARIATION_PASSWORD的文档:
Variation of TYPE_CLASS_TEXT: entering a password.
在哪种情况下,表格被视为“网络表格”?
两者之间的行为有什么不同吗? (视觉上和/或逻辑上)
In which case is a form considered a “web form”?
如果EditText(html输入字段)在浏览器页面内(任何从用户输入的Web表单).
在web-from的情况下,我们需要使用InputType TYPE_TEXT_VARIATION_WEB_PASSWORD.
如果EditText在本机应用程序中是EditText的对象,那么需要使用TYPE_TEXT_VARIATION_PASSWORD
Is there any difference in behavIoUr between the two? (visually and/or
logically)
是,
见这里的com.android.inputmethod.latin.InputAttributes:
使用TYPE_TEXT_VARIATION_WEB_EDIT_TEXT标志:
// 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
但是对于TYPE_TEXT_VARIATION_PASSWORD,上面的InputType注释不为TRUE.