I specify EditText
android:inputType="textPassword" How to increase the size of the points behind which the password is EitText in EitText without changing the text size?
I specify EditText
android:inputType="textPassword" How to increase the size of the points behind which the password is EitText in EitText without changing the text size?
EditText has a setTransformationMethod() method
To which we pass an instance of this class:
private class MyPasswordTransformationMethod extends PasswordTransformationMethod { @Override public CharSequence getTransformation(CharSequence source, View view) { return new PasswordCharSequence(source); } private class PasswordCharSequence implements CharSequence { private CharSequence mSource; public PasswordCharSequence(CharSequence source) { mSource = source; } public char charAt(int index) { return '●'; } public int length() { return mSource.length(); } public CharSequence subSequence(int start, int end) { return mSource.subSequence(start, end); } } } Actually the most interesting thing here is in the charAt method:
public char charAt(int index) { return '●'; } Which returns the character that will display the entered character of the password.
Total with PasswordTransformationMethod data:
Source: https://ru.stackoverflow.com/questions/657729/
All Articles