Added in API level 1

ReplacementTransformationMethod


abstract class ReplacementTransformationMethod : TransformationMethod
HideReturnsTransformationMethod

This transformation method causes any carriage return characters (\r) to be hidden by displaying them as zero-width non-breaking space characters (\uFEFF).

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.

This transformation method causes the characters in the getOriginal array to be replaced by the corresponding characters in the getReplacement array.

Summary

Public constructors

Public methods
open CharSequence!

Returns a CharSequence that will mirror the contents of the source CharSequence but with the characters in getOriginal replaced by ones from getReplacement.

open Unit
onFocusChanged(view: View!, sourceText: CharSequence!, focused: Boolean, direction: Int, previouslyFocusedRect: Rect!)

Protected methods
abstract CharArray!

Returns the list of characters that are to be replaced by other characters when displayed.

abstract CharArray!

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

Public constructors

ReplacementTransformationMethod

ReplacementTransformationMethod()

Public methods

getTransformation

Added in API level 1
open fun getTransformation(
    source: CharSequence!,
    v: View!
): CharSequence!

Returns a CharSequence that will mirror the contents of the source CharSequence but with the characters in getOriginal replaced by ones from getReplacement.

onFocusChanged

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

Protected methods

getOriginal

Added in API level 1
protected abstract fun getOriginal(): CharArray!

Returns the list of characters that are to be replaced by other characters when displayed.

getReplacement

Added in API level 1
protected abstract fun getReplacement(): CharArray!

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