Package icyllis.modernui.text.method
Class PasswordTransformationMethod
java.lang.Object
icyllis.modernui.text.method.PasswordTransformationMethod
- All Implemented Interfaces:
TransformationMethod,NoCopySpan,TextWatcher
public class PasswordTransformationMethod
extends Object
implements TransformationMethod, TextWatcher
-
Nested Class Summary
Nested classes/interfaces inherited from interface icyllis.modernui.text.NoCopySpan
NoCopySpan.Concrete -
Method Summary
Modifier and TypeMethodDescriptionvoidThis method is called to notify you that, somewhere withins, the text has been changed.voidbeforeTextChanged(CharSequence s, int start, int count, int after) This method is called to notify you that, withins, thecountcharacters beginning atstartare about to be replaced by new text with lengthafter.static PasswordTransformationMethodgetTransformation(CharSequence source, View view) Returns a CharSequence that is a transformation of the source text -- for example, replacing each character with a dot in a password field.voidonFocusChanged(View view, CharSequence sourceText, boolean focused, int direction, Rect previouslyFocusedRect) This method is called when the TextView that uses this TransformationMethod gains or loses focus.voidonTextChanged(CharSequence s, int start, int before, int count) This method is called to notify you that, withins, thecountcharacters beginning atstarthave just replaced old text that had lengthbefore.
-
Method Details
-
getInstance
-
getTransformation
Description copied from interface:TransformationMethodReturns a CharSequence that is a transformation of the source text -- for example, replacing each character with a dot in a password field. Beware that the returned text must be exactly the same length as the source text, and that if the source text is Editable, the returned text must mirror it dynamically instead of doing a one-time copy.- Specified by:
getTransformationin interfaceTransformationMethod
-
onFocusChanged
public void onFocusChanged(@Nonnull View view, @Nonnull CharSequence sourceText, boolean focused, int direction, @Nullable Rect previouslyFocusedRect) Description copied from interface:TransformationMethodThis method is called when the TextView that uses this TransformationMethod gains or loses focus.- Specified by:
onFocusChangedin interfaceTransformationMethod
-
beforeTextChanged
Description copied from interface:TextWatcherThis method is called to notify you that, withins, thecountcharacters beginning atstartare about to be replaced by new text with lengthafter. It is an error to attempt to make changes tosfrom this callback.- Specified by:
beforeTextChangedin interfaceTextWatcher
-
onTextChanged
Description copied from interface:TextWatcherThis method is called to notify you that, withins, thecountcharacters beginning atstarthave just replaced old text that had lengthbefore. It is an error to attempt to make changes tosfrom this callback.- Specified by:
onTextChangedin interfaceTextWatcher
-
afterTextChanged
Description copied from interface:TextWatcherThis method is called to notify you that, somewhere withins, the text has been changed. It is legitimate to make further changes tosfrom this callback, but be careful not to get yourself into an infinite loop, because any changes you make will cause this method to be called again recursively. (You are not told where the change took place because other afterTextChanged() methods may already have made other changes and invalidated the offsets. But if you need to know here, you can useSpannable.setSpan(java.lang.Object, int, int, int)inTextWatcher.onTextChanged(java.lang.CharSequence, int, int, int)to mark your place and then look up from here where the span ended up.- Specified by:
afterTextChangedin interfaceTextWatcher
-