editorActionEvents
fun TextView.editorActionEvents(handled: (EditorActionEvent) -> Boolean = { true }): Flow<EditorActionEvent>
Create a Flow of editor action events on the TextView instance.
Parameters
handled
function to be invoked with each value to determine the return value of the underlying TextView.OnEditorActionListener. Note that the Flow will only emit when this function evaluates to true.
Note: Created flow keeps a strong reference to the TextView instance until the coroutine that launched the flow collector is cancelled.
Example of usage:
textView.editorActionEvents { event.actionId == EditorInfo.IME_ACTION_GO }
.onEach { event ->
// handle text view editor action event
}
.launchIn(uiScope)
Content copied to clipboard