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

MoveCursorCommand

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

Moves the cursor with amount characters.

If there is selection, cancel the selection first and move the cursor to the selection start position. Then perform the cursor movement.

Summary

Public constructors
<init>(amount: Int)

Moves the cursor with amount characters.

Public methods
Unit

Apply the command on the editing buffer.

Boolean
equals(other: Any?)

Int

String

Properties
Int

The amount of cursor movement.

Public constructors

<init>

MoveCursorCommand(amount: Int)

Moves the cursor with amount characters.

If there is selection, cancel the selection first and move the cursor to the selection start position. Then perform the cursor movement.

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

amount

val amount: Int

The amount of cursor movement.

If you want to move backward, pass negative value.