Posts

Showing posts with the label Password

Convert Password Characters into a placeholder character.

Image
Overview This code is used to covert password characters into an Asterisk. To do that you have to create a class and extend the class with PasswordTransformationMethod public class AsteriskMethod extends PasswordTransformationMethod { public CharSequence mPassword ; @Override public CharSequence getTransformation (CharSequence source , View view) { return new AsteriskMethod.PasswordCharSequence(source) ; } private class PasswordCharSequence implements CharSequence { public PasswordCharSequence (CharSequence source) { mPassword = source ; // Store char sequence } public char charAt ( int index) { return '*' ; // This is the important part } public int length () { return mPassword .length() ; // Return default } public CharSequence subSequence ( int start , int end) { return mPassword .subSequence(start , end) ; // Return default ...