Added in API level 1

TransformationMethod

interface TransformationMethod
android.text.method.TransformationMethod

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(source: CharSequence!, 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 Unit
onFocusChanged(view: View!, sourceText: CharSequence!, focused: Boolean, direction: Int, previouslyFocusedRect: Rect!)

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

Public methods

getTransformation

Added in API level 1
abstract fun getTransformation(
    source: CharSequence!,
    view: View!
): CharSequence!

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.

onFocusChanged

Added in API level 1
abstract fun onFocusChanged(
    view: View!,
    sourceText: CharSequence!,
    focused: Boolean,
    direction: Int,
    previouslyFocusedRect: Rect!
): Unit

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