androidx.compose.ui.text.input

Interfaces

EditCommand

EditCommand is a command representation for the platform IME API function calls.

Cmn
InputEventCallback

This interface is deprecated. This function is not being used by any APIs.

Cmn
OffsetMapping

Provides bidirectional offset mapping between original and transformed text.

Cmn
PlatformTextInputService

This interface is deprecated. Use PlatformTextInputModifierNode instead.

Cmn
VisualTransformation

Interface used for changing visual output of the input field.

Cmn

Classes

BackspaceCommand

Represents a backspace operation at the cursor position.

Cmn
CommitTextCommand

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

Cmn
DeleteAllCommand

Deletes all the text in the buffer.

Cmn
DeleteSurroundingTextCommand

Delete lengthBeforeCursor characters of text before the current cursor position, and delete lengthAfterCursor characters of text after the current cursor position, excluding the selection.

Cmn
DeleteSurroundingTextInCodePointsCommand

A variant of DeleteSurroundingTextCommand.

Cmn
EditProcessor

Helper class to apply EditCommands on an internal buffer.

Cmn
EditingBuffer

The editing buffer

Cmn
FinishComposingTextCommand

Finishes the composing text that is currently active.

Cmn
ImeAction

Signals the keyboard what type of action should be displayed.

Cmn
ImeOptions

The IME configuration options for TextInputService.

Cmn
KeyboardCapitalization

Options to request software keyboard to capitalize the text.

Cmn
KeyboardType

Values representing the different available Keyboard Types.

Cmn
MoveCursorCommand

Moves the cursor with amount characters.

Cmn
PasswordVisualTransformation

The Visual Filter can be used for password Input Field.

Cmn
PlatformImeOptions

Used to configure the platform specific IME options.

Cmn
android
SetComposingRegionCommand

Mark a certain region of text as composing text.

Cmn
SetComposingTextCommand

Replace the currently composing text with the given text, and set the new cursor position.

Cmn
SetSelectionCommand

Sets the selection on the text.

Cmn
TextFieldValue

A class holding information about the editing state.

Cmn
TextInputService

This class is deprecated. Use PlatformTextInputModifierNode instead.

Cmn
TextInputSession

This class is deprecated. Use PlatformTextInputModifierNode instead.

Cmn
TransformedText

The transformed text with offset offset mapping

Cmn

Extension functions summary

AnnotatedString

Returns the currently selected text.

Cmn
AnnotatedString

Returns the text after the selection.

Cmn
AnnotatedString

Returns the text before the selection.

Cmn

Extension functions

getSelectedText

fun TextFieldValue.getSelectedText(): AnnotatedString

Returns the currently selected text.

getTextAfterSelection

fun TextFieldValue.getTextAfterSelection(maxChars: Int): AnnotatedString

Returns the text after the selection.

Parameters
maxChars: Int

maximum number of characters (exclusive) after the maximum value in TextFieldValue.selection.

See also
max

getTextBeforeSelection

fun TextFieldValue.getTextBeforeSelection(maxChars: Int): AnnotatedString

Returns the text before the selection.

Parameters
maxChars: Int

maximum number of characters (inclusive) before the minimum value in TextFieldValue.selection.

See also
min