EditProcessor
-
Cmn
class EditProcessor
Helper class to apply EditCommands on an internal buffer. Used by TextField Composable to combine TextFieldValue lifecycle with the editing operations.
-
When a
TextFieldValueis suggested by the developer,resetshould be called. -
When
TextInputServiceprovidesEditCommands, they should be applied to the internal buffer usingapply.
Summary
Public constructors |
|
|---|---|
|
Cmn
|
Public functions |
||
|---|---|---|
TextFieldValue |
apply(editCommands: List<EditCommand>)Applies a set of |
Cmn
|
Unit |
reset(value: TextFieldValue, textInputSession: TextInputSession?)Must be called whenever new editor model arrives. |
Cmn
|
TextFieldValue |
Returns the current state of the internal editing buffer as a |
Cmn
|
Public constructors
Public functions
apply
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: List<EditCommand> |
|
| Returns | |
|---|---|
TextFieldValue |
the |
reset
fun reset(value: TextFieldValue, textInputSession: TextInputSession?): Unit
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.
toTextFieldValue
fun toTextFieldValue(): TextFieldValue
Returns the current state of the internal editing buffer as a TextFieldValue.