Most visited

Recently visited

Added in API level 1

ReplacementTransformationMethod

public abstract class ReplacementTransformationMethod
extends Object implements TransformationMethod

java.lang.Object
   ↳ android.text.method.ReplacementTransformationMethod
Known Direct Subclasses


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

From class java.lang.Object
From interface android.text.method.TransformationMethod

Public constructors

ReplacementTransformationMethod

Added in API level 1
ReplacementTransformationMethod ()

Public methods

getTransformation

Added in API level 1
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
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
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
char[] getReplacement ()

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

Returns
char[]

Hooray!