{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

PlatformTextInputService

public interface PlatformTextInputService


Platform specific text input service.

Summary

Public methods

abstract void

Hide software keyboard

default void

Notify the focused rectangle to the system.

abstract void

Request showing onscreen keyboard

abstract void
startInput(
    @NonNull TextFieldValue value,
    @NonNull ImeOptions imeOptions,
    @NonNull Function1<@NonNull List<@NonNull EditCommand>, Unit> onEditCommand,
    @NonNull Function1<@NonNull ImeActionUnit> onImeActionPerformed
)

Start text input session for given client.

abstract void

Stop text input session.

abstract void

Public methods

hideSoftwareKeyboard

abstract void hideSoftwareKeyboard()

Hide software keyboard

notifyFocusedRect

default void notifyFocusedRect(@NonNull Rect rect)

Notify the focused rectangle to the system.

The system can ignore this information or use it to for additional functionality.

For example, desktop systems show a popup near the focused input area (for some languages).

showSoftwareKeyboard

abstract void showSoftwareKeyboard()

Request showing onscreen keyboard

There is no guarantee nor callback of the result of this API.

startInput

abstract void startInput(
    @NonNull TextFieldValue value,
    @NonNull ImeOptions imeOptions,
    @NonNull Function1<@NonNull List<@NonNull EditCommand>, Unit> onEditCommand,
    @NonNull Function1<@NonNull ImeActionUnit> onImeActionPerformed
)

Start text input session for given client.

See also
startInput

stopInput

abstract void stopInput()

Stop text input session.

See also
stopInput

updateState

abstract void updateState(TextFieldValue oldValue, @NonNull TextFieldValue newValue)