Interface

PlatformTextInputService

Platform specific text input service.

Source set: Common
@Deprecated("Use PlatformTextInputModifierNode instead.")
public interface PlatformTextInputService

Platform specific text input service.

Functions

startInput

Source set: Common
public fun startInput(
        value: TextFieldValue,
        imeOptions: ImeOptions,
        onEditCommand: (List<EditCommand>) -> Unit,
        onImeActionPerformed: (ImeAction) -> Unit,
    )

Start text input session for given client.

startInput

Source set: Common
public fun startInput(): Unit

Restart input and show the keyboard. This should only be called when starting a new PlatformTextInputModifierNode.textInputSession.

stopInput

Source set: Common
public fun stopInput()

Stop text input session.

showSoftwareKeyboard

Source set: Common
public fun showSoftwareKeyboard()

Request showing onscreen keyboard

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

hideSoftwareKeyboard

Source set: Common
public fun hideSoftwareKeyboard()

Hide software keyboard

updateState

Source set: Common
public fun updateState(oldValue: TextFieldValue?, newValue: TextFieldValue)

Notify the new editor model to IME.

notifyFocusedRect

Source set: Common
public fun notifyFocusedRect(rect: Rect): Unit

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).

updateTextLayoutResult

Source set: Common
public fun updateTextLayoutResult(
        textFieldValue: TextFieldValue,
        offsetMapping: OffsetMapping,
        textLayoutResult: TextLayoutResult,
        textFieldToRootTransform: (Matrix) -> Unit,
        innerTextFieldBounds: Rect,
        decorationBoxBounds: Rect,
    ): Unit

Notify the input service of layout and position changes.

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: