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 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

      @Nonnull public CharSequence getTransformation(@Nonnull CharSequence source, @Nonnull View v)
      Returns a CharSequence that will mirror the contents of the source CharSequence but with the characters in getOriginal() replaced by ones from getReplacement().
      Specified by:
      getTransformation in interface TransformationMethod
    • 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 interface TransformationMethod