Currently I am implementing a custom textView for passcode entry. I'm using a custom transformation to show the last number entered like so:
public class PinCodePasswordTransformationMethod extends PasswordTransformationMethod {
char passwordBullet = '\u26aa';
@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; // Store char sequence
}
public char charAt(int index) {
if(index != mSource.length()-1)
return passwordBullet;
else
return mSource.charAt(index);
}
public int length() {
return mSource.length(); // Return default
}
public CharSequence subSequence(int start, int end) {
return mSource.subSequence(start, end); // Return default
}
}
}
and apply it on the textview as so:
mTextView.setTransformationMethod(new PinCodePasswordTransformationMethod());
Right now each letter appears instantly when inputed. How can I animate changes so that the entry of new pin number and change of second last number to the password bullet character is animated?