Created
December 19, 2015 09:30
-
-
Save deskid/31d4bd047f7ecdb940e1 to your computer and use it in GitHub Desktop.
显示密码toggle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 设置密码是否可见 | |
*/ | |
public static void passwordVisibleToggle(EditText editText) { | |
Log.d("input", "passwordVisibleToggle " + editText.getInputType()); | |
if (editText.getInputType() == InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD) { | |
editText.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD | InputType.TYPE_CLASS_TEXT); | |
} else { | |
editText.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment