Package icyllis.modernui.text.method
Class ReplacementTransformationMethod
java.lang.Object
icyllis.modernui.text.method.ReplacementTransformationMethod
- All Implemented Interfaces:
TransformationMethod
- Direct Known Subclasses:
SingleLineTransformationMethod
public abstract class ReplacementTransformationMethod
extends Object
implements TransformationMethod
This transformation method causes the characters in the
getOriginal()
array to be replaced by the corresponding characters in the
getReplacement()
array.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract char[]
Returns the list of characters that are to be replaced by other characters when displayed.protected abstract char[]
Returns a parallel array of replacement characters for the ones that are to be replaced.getTransformation
(CharSequence source, View v) Returns a CharSequence that will mirror the contents of the source CharSequence but with the characters ingetOriginal()
replaced by ones fromgetReplacement()
.void
onFocusChanged
(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.
-
Constructor Details
-
ReplacementTransformationMethod
protected ReplacementTransformationMethod()
-
-
Method Details
-
getOriginal
protected abstract char[] getOriginal()Returns the list of characters that are to be replaced by other characters when displayed. -
getReplacement
protected abstract char[] getReplacement()Returns a parallel array of replacement characters for the ones that are to be replaced. -
getTransformation
Returns a CharSequence that will mirror the contents of the source CharSequence but with the characters ingetOriginal()
replaced by ones fromgetReplacement()
.- Specified by:
getTransformation
in interfaceTransformationMethod
-
onFocusChanged
public void onFocusChanged(@Nonnull View view, @Nonnull CharSequence sourceText, boolean focused, int direction, @Nullable Rect previouslyFocusedRect) Description copied from interface:TransformationMethod
This method is called when the TextView that uses this TransformationMethod gains or loses focus.- Specified by:
onFocusChanged
in interfaceTransformationMethod
-