Last active
July 6, 2020 18:55
-
-
Save catalinghita8/fc7efe30aeadac0e5d9f51202a97aef2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| private fun requestExtractQuery(bundle: Bundle?) { | |
| val data = bundle?.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION) | |
| data?.let { results -> | |
| val resultedText = results[0] // First we set the text result to a TextView | |
| txtSpeechInput.text = resultedText | |
| // Secondly, we send a processing command downstream to the viewModel | |
| // In return, we get a colorized text result with the noun highlighted and we set it again | |
| val result: Spannable = viewModel.requestQuery(resultedText) | |
| txtSpeechInput.text = result | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment