# Print output for @column tags ?> ReplacementTransformationMethod - Android SDK | Android Developers

Most visited


Recently visited


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

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

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

protected abstract char[] getOriginal ()

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

Returns
char[]

getReplacement

protected abstract char[] getReplacement ()

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

Returns
char[]

Browse this site in English?

You requested a page in English, but your language preference for this site is English.

Would you like to change your language preference and browse this site in English? If you want to change your language preference later, use the language menu at the bottom of each page.