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


这种变换方法使得在字符 getOriginal()阵列由在相应的字符来代替 getReplacement()阵列。

Summary

Public constructors

ReplacementTransformationMethod()

Public methods

CharSequence getTransformation(CharSequence source, View v)

返回一个CharSequence,它将镜像源CharSequence的内容,但将 getOriginal()的字符替换为 getReplacement()

void onFocusChanged(View view, CharSequence sourceText, boolean focused, int direction, Rect previouslyFocusedRect)

当使用此TransformationMethod的TextView获得或失去焦点时,将调用此方法。

Protected methods

abstract char[] getOriginal()

返回显示时将被其他字符替换的字符列表。

abstract char[] getReplacement()

为要替换的字符返回并行字符数组。

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)

返回一个CharSequence,它将镜像源CharSequence的内容,但将 getOriginal()的字符替换为 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)

当使用此TransformationMethod的TextView获得或失去焦点时,将调用此方法。

Parameters
view View
sourceText CharSequence
focused boolean
direction int
previouslyFocusedRect Rect

Protected methods

getOriginal

Added in API level 1
char[] getOriginal ()

返回显示时将被其他字符替换的字符列表。

Returns
char[]

getReplacement

Added in API level 1
char[] getReplacement ()

为要替换的字符返回并行字符数组。

Returns
char[]

Hooray!