Skip to content

Instantly share code, notes, and snippets.

@TheBotBox
Created June 5, 2020 11:52
Embed
What would you like to do?
fun EditText.onDone(callback: (String) -> Unit) {
setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_DONE) {
callback.invoke(text.toString())
true
}
false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment