ReplacementTransformationMethod

public abstract class ReplacementTransformationMethod
extends Object implements TransformationMethod

java.lang.Object
   ↳ android.text.method.ReplacementTransformationMethod


This transformation method causes the characters in the getOriginal() array to be replaced by the corresponding characters in the getReplacement() array.

Summary

Public constructors

ReplacementTransformationMethod()

Public methods

CharSequence getTransformation(CharSequence source, 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().

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.

Protected methods

abstract char[] getOriginal()

Returns the list of characters that are to be replaced by other characters when displayed.

abstract char[] getReplacement()

Returns a parallel array of replacement characters for the ones that are to be replaced.

Inherited methods

Public constructors

ReplacementTransformationMethod

public ReplacementTransformationMethod ()

Public methods

getTransformation

Added in API level 1
public CharSequence getTransformation (CharSequence source, 
                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().

Parameters
source CharSequence

v View

Returns
CharSequence

onFocusChanged

Added in API level 1
public 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.

Parameters
view View

sourceText CharSequence

focused boolean

direction int

previouslyFocusedRect Rect

Protected methods

getOriginal

Added in API level 1
protected abstract char[] getOriginal ()

Returns the list of characters that are to be replaced by other characters when displayed.

Returns
char[]

getReplacement

Added in API level 1
protected abstract char[] getReplacement ()

Returns a parallel array of replacement characters for the ones that are to be replaced.

Returns
char[]