Package icyllis.modernui.text
Interface TextWatcher
- All Superinterfaces:
NoCopySpan
- All Known Implementing Classes:
PasswordTransformationMethod
When an object of this type is attached to an Editable, its methods will
be called when the text is changed.
-
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.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
-
beforeTextChanged
This 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. -
onTextChanged
This 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. -
afterTextChanged
This 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)inonTextChanged(java.lang.CharSequence, int, int, int)to mark your place and then look up from here where the span ended up.
-