Created
April 6, 2020 00:26
-
-
Save miguelhincapie/8c853af32d0d9ff413ffd827780a5789 to your computer and use it in GitHub Desktop.
Snippet showing how to send an accessibility event to viewModel.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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