Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save miguelhincapie/8c853af32d0d9ff413ffd827780a5789 to your computer and use it in GitHub Desktop.
Save miguelhincapie/8c853af32d0d9ff413ffd827780a5789 to your computer and use it in GitHub Desktop.
Snippet showing how to send an accessibility event to viewModel.
override fun dispatchKeyEvent(event: KeyEvent?): Boolean {
return event?.let {
currentFocus?.let { focusView ->
talkBackViewModel.dispatchKeyEvent(it, WeakReference(focusView))
}
} ?: super.dispatchKeyEvent(event)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment