# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Methods

# TransformationMethod

`public interface TransformationMethod`
``

android.text.method.TransformationMethod

Known indirect subclasses HideReturnsTransformationMethod, PasswordTransformationMethod, ReplacementTransformationMethod, SingleLineTransformationMethod
HideReturnsTransformationMethod | This transformation method causes any carriage return characters (\r) to be hidden by displaying them as zero-width non-breaking space characters (﻿).
PasswordTransformationMethod |
ReplacementTransformationMethod | This transformation method causes the characters in the `getOriginal()` array to be replaced by the corresponding characters in the `getReplacement()` array.
SingleLineTransformationMethod | This transformation method causes any newline characters (\n) to be displayed as spaces instead of causing line breaks, and causes carriage return characters (\r) to have no appearance.

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

### getTransformation

    public 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. 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. The method should not return `null` unless `source` is `null`.

Parameters
`source` | `CharSequence`
`view` | `View`

Returns
`CharSequence` |

### onFocusChanged

    public 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.

Parameters
`view` | `View`
`sourceText` | `CharSequence`
`focused` | `boolean`
`direction` | `int`
`previouslyFocusedRect` | `Rect`

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*