Android 12 Developer Preview is here! Try it out, and give us your feedback!

CommitTextCommand

class CommitTextCommand : EditCommand
kotlin.Any
   ↳ androidx.compose.ui.text.input.CommitTextCommand

Commit final text to the text box and set the new cursor position.

Summary

Public constructors
<init>(text: String, newCursorPosition: Int)

<init>(annotatedString: AnnotatedString, newCursorPosition: Int)

Commit final text to the text box and set the new cursor position.

Public methods
Unit

Apply the command on the editing buffer.

Boolean
equals(other: Any?)

Int

String

Properties
AnnotatedString

The text to commit.

Int

The cursor position after inserted text.

String

Public constructors

<init>

CommitTextCommand(
    text: String,
    newCursorPosition: Int)

<init>

CommitTextCommand(
    annotatedString: AnnotatedString,
    newCursorPosition: Int)

Commit final text to the text box and set the new cursor position.

Public methods

applyTo

fun applyTo(buffer: EditingBuffer): Unit

Apply the command on the editing buffer.

equals

fun equals(other: Any?): Boolean

hashCode

fun hashCode(): Int

toString

fun toString(): String

Properties

annotatedString

val annotatedString: AnnotatedString

The text to commit.

newCursorPosition

val newCursorPosition: Int

The cursor position after inserted text.

text

val text: String