Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
public interface

TransformationMethod

android.text.method.TransformationMethod
Known Indirect Subclasses

Class Overview

TextView uses TransformationMethods to do things like replacing the characters of passwords with dots, or keeping the newline characters from causing line breaks in single-line text fields.

Summary

Public Methods
abstract CharSequence getTransformation ( CharSequence source, View view)
Returns a CharSequence that is a transformation of the source text -- for example, replacing each character with a dot in a password field.
abstract 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.

Public Methods

public abstract CharSequence getTransformation ( CharSequence source, View view)

Added in API level 1

Returns a CharSequence that is a transformation of the source text -- for example, replacing each character with a dot in a password field. Beware that the returned text must be exactly the same length as the source text, and that if the source text is Editable, the returned text must mirror it dynamically instead of doing a one-time copy.

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

Added in API level 1

This method is called when the TextView that uses this TransformationMethod gains or loses focus.