The second Android 11 Developer Preview is now available, test it out and share your feedback.

TextFieldValue

data class TextFieldValue
kotlin.Any
   ↳ androidx.ui.text.TextFieldValue

A class holding information about the editing state.

The input service updates text selection or cursor as well as text. You can observe and control the selection, cursor and text altogether.

Summary

Public constructors

<init>(text: String = "", selection: TextRange = TextRange(0, 0))

A class holding information about the editing state.

Properties

TextRange

the selection range.

String

the text will be rendered

Public constructors

<init>

TextFieldValue(
    text: String = "",
    selection: TextRange = TextRange(0, 0))

A class holding information about the editing state.

The input service updates text selection or cursor as well as text. You can observe and control the selection, cursor and text altogether.

Parameters
text: String = "" the text will be rendered
selection: TextRange = TextRange(0, 0) the selection range. If the selection is collapsed, it represents cursor location. Do not specify outside of the text buffer.

Properties

selection

val selection: TextRange

the selection range. If the selection is collapsed, it represents cursor location. Do not specify outside of the text buffer.

text

val text: String

the text will be rendered