imeSetComposition

This method sets the current candidate text for IME. Use imeCommitComposition to commit the final text. Use imeSetComposition with empty string as text to cancel composition.

Official doc

Note: this function uses an input class, and constructing this class manually may lead to incompatibilities if the class's constructor arguments change in the future. For maximum compatibility, it is advised to use the overload of this function that directly takes the mandatory parameters as arguments, and the optional ones from a configuration lambda.


inline suspend fun imeSetComposition(text: String, selectionStart: Int, selectionEnd: Int, optionalArgs: ImeSetCompositionRequest.Builder.() -> Unit = {}): ImeSetCompositionResponse

This method sets the current candidate text for IME. Use imeCommitComposition to commit the final text. Use imeSetComposition with empty string as text to cancel composition.

Official doc

Parameters

text

The text to insert

selectionStart

selection start

selectionEnd

selection end