/**
* Returns whether the password visibility toggle functionality is enabled or not.
*
* <p>When enabled, a button is placed at the end of the EditText which enables the user
* to switch between the field's input being visibly disguised or not.</p>
*
* @param enabled true to enable the functionality
*
* @attr ref android.support.design.R.styleable#TextInputLayout_passwordToggleEnabled
*/
public void setPasswordVisibilityToggleEnabled(final boolean enabled) {
if (mPasswordToggleEnabled != enabled) {
mPasswordToggleEnabled = enabled;
if (!enabled && mPasswordToggledVisible && mEditText != null) {
// If the toggle is no longer enabled, but we remove the PasswordTransformation
// to make the password visible, add it back
mEditText.setTransformationMethod(PasswordTransformationMethod.getInstance());
}
// Reset the visibility tracking flag
mPasswordToggledVisible = false;
updatePasswordToggleView();
}
}
TextInputLayout.java 文件源码
java
阅读 23
收藏 0
点赞 0
评论 0
项目:cwac-crossport
作者:
评论列表
文章目录