🌈 Create new beautiful Compose Gradients with our new wesite ->
Class

EditProcessor

Helper class to apply EditCommands on an internal buffer.

Source set: Common
public class EditProcessor

Helper class to apply EditCommands on an internal buffer. Used by TextField Composable to combine TextFieldValue lifecycle with the editing operations.

Functions

reset

Source set: Common
public fun reset(value: TextFieldValue, textInputSession: TextInputSession?)

Must be called whenever new editor model arrives.

This method updates the internal editing buffer with the given editor model. This method may tell the IME about the selection offset changes or extracted text changes.

apply

Source set: Common
public fun apply(editCommands: List<EditCommand>): TextFieldValue

Applies a set of editCommands to the internal text editing buffer.

After applying the changes, returns the final state of the editing buffer as a TextFieldValue

Parameters

editCommands EditCommands to be applied to the editing buffer.

Return

the TextFieldValue representation of the final buffer state.

toTextFieldValue

Source set: Common
public fun toTextFieldValue(): TextFieldValue

Returns the current state of the internal editing buffer as a TextFieldValue.