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

SetSelectionCommand

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

Sets the selection on the text. When start and end have the same value, it sets the cursor position.

Summary

Public constructors
<init>(start: Int, end: Int)

Sets the selection on the text.

Public methods
Unit

Apply the command on the editing buffer.

Boolean
equals(other: Any?)

Int

String

Properties
Int

The exclusive end offset of the selection region.

Int

The inclusive start offset of the selection region.

Public constructors

<init>

SetSelectionCommand(
    start: Int,
    end: Int)

Sets the selection on the text. When start and end have the same value, it sets the 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

end

val end: Int

The exclusive end offset of the selection region.

start

val start: Int

The inclusive start offset of the selection region.