Merge pull request #302 from Inhishonor/error-no-stt

Check to see if STT provider is available and if not abort process.
This commit is contained in:
octoshrimpy
2025-02-23 16:14:03 -05:00
committed by GitHub
2 changed files with 180 additions and 170 deletions
@@ -23,6 +23,7 @@ import android.animation.LayoutTransition
import android.app.Activity import android.app.Activity
import android.app.DatePickerDialog import android.app.DatePickerDialog
import android.app.TimePickerDialog import android.app.TimePickerDialog
import android.content.ActivityNotFoundException
import android.content.ContentValues import android.content.ContentValues
import android.content.Intent import android.content.Intent
import android.content.res.ColorStateList import android.content.res.ColorStateList
@@ -33,6 +34,7 @@ import android.os.SystemClock
import android.provider.ContactsContract import android.provider.ContactsContract
import android.provider.MediaStore import android.provider.MediaStore
import android.speech.RecognizerIntent import android.speech.RecognizerIntent
import android.speech.SpeechRecognizer
import android.text.format.DateFormat import android.text.format.DateFormat
import android.view.ContextMenu import android.view.ContextMenu
import android.view.DragEvent.ACTION_DRAG_ENDED import android.view.DragEvent.ACTION_DRAG_ENDED
@@ -218,6 +220,10 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
.autoDisposable(scope()) .autoDisposable(scope())
} }
private fun isSpeechRecognitionAvailable(): Boolean {
return SpeechRecognizer.isRecognitionAvailable(this)
}
private val speechResultLauncher = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result -> private val speechResultLauncher = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
if (result.resultCode != Activity.RESULT_OK) if (result.resultCode != Activity.RESULT_OK)
return@registerForActivityResult return@registerForActivityResult
@@ -237,7 +243,6 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
message.setSelection(message.text.length) message.setSelection(message.text.length)
message.requestFocus() message.requestFocus()
} }
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
AndroidInjection.inject(this) AndroidInjection.inject(this)
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
@@ -248,165 +253,167 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
contentView.layoutTransition = LayoutTransition().apply { contentView.layoutTransition = LayoutTransition().apply {
disableTransitionType(LayoutTransition.CHANGING) disableTransitionType(LayoutTransition.CHANGING)
} }
chipsAdapter.view = chips
chipsAdapter.view = chips chips.itemAnimator = null
chips.layoutManager = FlexboxLayoutManager(this)
chips.itemAnimator = null messageAdapter.autoScrollToStart(messageList)
chips.layoutManager = FlexboxLayoutManager(this) messageAdapter.emptyView = messagesEmpty
messageAdapter.autoScrollToStart(messageList) messageList.setHasFixedSize(true)
messageAdapter.emptyView = messagesEmpty messageList.adapter = messageAdapter
messageList.setHasFixedSize(true) messageAttachments.adapter = composeAttachmentAdapter
messageList.adapter = messageAdapter
messageAttachments.adapter = composeAttachmentAdapter message.supportsInputContent = true
message.supportsInputContent = true theme
.doOnNext { loading.setTint(it.theme) }
theme .doOnNext { attach.setBackgroundTint(it.theme) }
.doOnNext { loading.setTint(it.theme) } .doOnNext { attach.setTint(it.textPrimary) }
.doOnNext { attach.setBackgroundTint(it.theme) } .doOnNext { speechToTextIconBorder.setBackgroundTint(it.theme) }
.doOnNext { attach.setTint(it.textPrimary) } .doOnNext { speechToTextIcon.setBackgroundTint(it.textPrimary) }
.doOnNext { speechToTextIconBorder.setBackgroundTint(it.theme) } .doOnNext { speechToTextIcon.setTint(it.theme) }
.doOnNext { speechToTextIcon.setBackgroundTint(it.textPrimary) } .doOnNext { audioMsgRecord.setColor(it.theme) }
.doOnNext { speechToTextIcon.setTint(it.theme) } .doOnNext { audioMsgPlayerPlayPause.setTint(it.theme) }
.doOnNext { audioMsgRecord.setColor(it.theme) } .doOnNext {
.doOnNext { audioMsgPlayerPlayPause.setTint(it.theme) } audioMsgPlayerSeekBar.apply {
.doOnNext { thumbTintList = ColorStateList.valueOf(it.theme)
audioMsgPlayerSeekBar.apply { progressBackgroundTintList = ColorStateList.valueOf(it.theme)
thumbTintList = ColorStateList.valueOf(it.theme) progressTintList = ColorStateList.valueOf(it.theme)
progressBackgroundTintList = ColorStateList.valueOf(it.theme) }
progressTintList = ColorStateList.valueOf(it.theme)
} }
} .doOnNext { messageAdapter.theme = it }
.doOnNext { messageAdapter.theme = it } .autoDisposable(scope())
.autoDisposable(scope()) .subscribe()
.subscribe()
// context menu registration for message parts // context menu registration for message parts
messagePartContextMenuRegistrar messagePartContextMenuRegistrar
.mapNotNull { it } .mapNotNull { it }
.autoDisposable(scope()) .autoDisposable(scope())
.subscribe { registerForContextMenu(it) } .subscribe { registerForContextMenu(it) }
// drag drop handlers for speech-to-text icon // drag drop handlers for speech-to-text icon
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
speechToTextIcon.setOnLongClickListener { speechToTextIcon.setOnLongClickListener {
it.startDragAndDrop(null, View.DragShadowBuilder(speechToTextFrame), null, 0) it.startDragAndDrop(null, View.DragShadowBuilder(speechToTextFrame), null, 0)
speechToTextFrame.isVisible = false speechToTextFrame.isVisible = false
contentView.setOnDragListener { _, event -> contentView.setOnDragListener { _, event ->
when (event.action) { when (event.action) {
ACTION_DROP -> { ACTION_DROP -> {
speechToTextFrame.x = (event.x - (speechToTextFrame.width / 2)) speechToTextFrame.x = (event.x - (speechToTextFrame.width / 2))
speechToTextFrame.y =(event.y - (speechToTextFrame.height / 2)) speechToTextFrame.y = (event.y - (speechToTextFrame.height / 2))
// get offset from root view as a percentage of root view for saving // get offset from root view as a percentage of root view for saving
prefs.showSttOffsetX.set((speechToTextFrame.x - contentView.x) / contentView.width) prefs.showSttOffsetX.set((speechToTextFrame.x - contentView.x) / contentView.width)
prefs.showSttOffsetY.set((speechToTextFrame.y - contentView.y) / contentView.height) prefs.showSttOffsetY.set((speechToTextFrame.y - contentView.y) / contentView.height)
} }
ACTION_DRAG_ENDED, ACTION_DRAG_EXITED -> {
speechToTextFrame.isVisible = true ACTION_DRAG_ENDED, ACTION_DRAG_EXITED -> {
speechToTextFrame.isVisible = true
}
} }
true
} }
true true
} }
true
} }
}
// start/stop audio message recording // start/stop audio message recording
audioMsgRecord.setOnClickListener { audioMsgRecord.setOnClickListener {
recordAudioRecord.onNext(audioMsgRecord.getState()) recordAudioRecord.onNext(audioMsgRecord.getState())
} }
recordAudioChronometer recordAudioChronometer
.subscribeOn(AndroidSchedulers.mainThread()) .subscribeOn(AndroidSchedulers.mainThread())
.distinctUntilChanged() .distinctUntilChanged()
.autoDisposable(scope()) .autoDisposable(scope())
.subscribe { .subscribe {
if (it) { if (it) {
audioMsgDuration.base = SystemClock.elapsedRealtime() audioMsgDuration.base = SystemClock.elapsedRealtime()
audioMsgDuration.start() audioMsgDuration.start()
} else { } else {
audioMsgDuration.stop() audioMsgDuration.stop()
}
} }
// audio record playback play/pause button
audioMsgPlayerPlayPause.setOnClickListener {
recordAudioPlayerPlayPause.onNext(
audioMsgPlayerPlayPause.tag as QkMediaPlayer.PlayingState
)
} }
// audio record playback play/pause button recordAudioMsgRecordVisible
audioMsgPlayerPlayPause.setOnClickListener { .subscribeOn(AndroidSchedulers.mainThread())
recordAudioPlayerPlayPause.onNext( .distinctUntilChanged()
audioMsgPlayerPlayPause.tag as QkMediaPlayer.PlayingState .autoDisposable(scope())
) .subscribe {
} audioMsgRecord.isVisible = it
audioMsgDuration.isVisible =
it // chronometer follows record button visibility
audioMsgBluetooth.isVisible = !it
}
recordAudioMsgRecordVisible recordAudioPlayerVisible
.subscribeOn(AndroidSchedulers.mainThread()) .subscribeOn(AndroidSchedulers.mainThread())
.distinctUntilChanged() .distinctUntilChanged()
.autoDisposable(scope()) .autoDisposable(scope())
.subscribe { .subscribe {
audioMsgRecord.isVisible = it audioMsgPlayerBackground.isVisible = it
audioMsgDuration.isVisible = it // chronometer follows record button visibility recordAudioPlayerConfigUI.onNext(QkMediaPlayer.PlayingState.Stopped)
audioMsgBluetooth.isVisible = !it }
}
recordAudioPlayerVisible recordAudioPlayerConfigUI
.subscribeOn(AndroidSchedulers.mainThread()) .subscribeOn(AndroidSchedulers.mainThread())
.distinctUntilChanged() .distinctUntilChanged()
.autoDisposable(scope()) .autoDisposable(scope())
.subscribe { .subscribe {
audioMsgPlayerBackground.isVisible = it when (it) {
recordAudioPlayerConfigUI.onNext(QkMediaPlayer.PlayingState.Stopped) QkMediaPlayer.PlayingState.Playing -> {
} audioMsgPlayerPlayPause.tag = QkMediaPlayer.PlayingState.Playing
QkMediaPlayer.start()
recordAudioPlayerConfigUI audioMsgPlayerPlayPause.setImageResource(R.drawable.exo_icon_pause)
.subscribeOn(AndroidSchedulers.mainThread()) seekBarUpdater = getSeekBarUpdater().subscribe {
.distinctUntilChanged() audioMsgPlayerSeekBar.progress = QkMediaPlayer.currentPosition
.autoDisposable(scope()) audioMsgPlayerSeekBar.max = QkMediaPlayer.duration
.subscribe { }
when (it) { audioMsgPlayerSeekBar.isEnabled = true
QkMediaPlayer.PlayingState.Playing -> { }
audioMsgPlayerPlayPause.tag = QkMediaPlayer.PlayingState.Playing
QkMediaPlayer.start() QkMediaPlayer.PlayingState.Paused -> {
audioMsgPlayerPlayPause.setImageResource(R.drawable.exo_icon_pause) audioMsgPlayerPlayPause.tag = QkMediaPlayer.PlayingState.Paused
seekBarUpdater = getSeekBarUpdater().subscribe { QkMediaPlayer.pause()
audioMsgPlayerSeekBar.progress = QkMediaPlayer.currentPosition audioMsgPlayerPlayPause.setImageResource(R.drawable.exo_icon_play)
audioMsgPlayerSeekBar.max = QkMediaPlayer.duration seekBarUpdater?.dispose()
}
else -> {
audioMsgPlayerPlayPause.tag = QkMediaPlayer.PlayingState.Stopped
QkMediaPlayer.reset()
audioMsgPlayerPlayPause.setImageResource(R.drawable.exo_icon_play)
seekBarUpdater?.dispose()
audioMsgPlayerSeekBar.progress = 0
audioMsgPlayerSeekBar.isEnabled = false
} }
audioMsgPlayerSeekBar.isEnabled = true
}
QkMediaPlayer.PlayingState.Paused -> {
audioMsgPlayerPlayPause.tag = QkMediaPlayer.PlayingState.Paused
QkMediaPlayer.pause()
audioMsgPlayerPlayPause.setImageResource(R.drawable.exo_icon_play)
seekBarUpdater?.dispose()
}
else -> {
audioMsgPlayerPlayPause.tag = QkMediaPlayer.PlayingState.Stopped
QkMediaPlayer.reset()
audioMsgPlayerPlayPause.setImageResource(R.drawable.exo_icon_play)
seekBarUpdater?.dispose()
audioMsgPlayerSeekBar.progress = 0
audioMsgPlayerSeekBar.isEnabled = false
} }
} }
} // audio msg player seek bar handler
audioMsgPlayerSeekBar.setOnSeekBarChangeListener(
// audio msg player seek bar handler object : SeekBar.OnSeekBarChangeListener {
audioMsgPlayerSeekBar.setOnSeekBarChangeListener( override fun onProgressChanged(p0: SeekBar?, progress: Int, fromUser: Boolean) {
object : SeekBar.OnSeekBarChangeListener { // if seek was initiated by the user and this part is currently playing
override fun onProgressChanged(p0: SeekBar?, progress: Int, fromUser: Boolean) { if (fromUser)
// if seek was initiated by the user and this part is currently playing QkMediaPlayer.seekTo(progress)
if (fromUser) }
QkMediaPlayer.seekTo(progress) override fun onStartTrackingTouch(p0: SeekBar?) {}
override fun onStopTrackingTouch(p0: SeekBar?) {}
} }
override fun onStartTrackingTouch(p0: SeekBar?) {} )
override fun onStopTrackingTouch(p0: SeekBar?) {}
}
)
window.callback = ComposeWindowCallback(window.callback, this) window.callback = ComposeWindowCallback(window.callback, this)
} }
override fun onStart() { override fun onStart() {
@@ -455,7 +462,7 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
toolbarSubtitle.setVisible(state.query.isNotEmpty()) toolbarSubtitle.setVisible(state.query.isNotEmpty())
toolbarSubtitle.text = getString(R.string.compose_subtitle_results, state.searchSelectionPosition, toolbarSubtitle.text = getString(R.string.compose_subtitle_results, state.searchSelectionPosition,
state.searchResults) state.searchResults)
toolbarTitle.setVisible(!state.editingMode) toolbarTitle.setVisible(!state.editingMode)
chips.setVisible(state.editingMode) chips.setVisible(state.editingMode)
@@ -567,10 +574,10 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
override fun showDetails(details: String) { override fun showDetails(details: String) {
AlertDialog.Builder(this) AlertDialog.Builder(this)
.setTitle(R.string.compose_details_title) .setTitle(R.string.compose_details_title)
.setMessage(details) .setMessage(details)
.setCancelable(true) .setCancelable(true)
.show() .show()
} }
override fun showMessageLinkAskDialog(uri: Uri) { override fun showMessageLinkAskDialog(uri: Uri) {
@@ -604,8 +611,8 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
override fun requestSmsPermission() { override fun requestSmsPermission() {
ActivityCompat.requestPermissions(this, arrayOf( ActivityCompat.requestPermissions(this, arrayOf(
Manifest.permission.READ_SMS, Manifest.permission.READ_SMS,
Manifest.permission.SEND_SMS), 0) Manifest.permission.SEND_SMS), 0)
} }
override fun requestDatePicker() { override fun requestDatePicker() {
@@ -619,7 +626,7 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
calendar.set(Calendar.MINUTE, minute) calendar.set(Calendar.MINUTE, minute)
scheduleSelectedIntent.onNext(calendar.timeInMillis) scheduleSelectedIntent.onNext(calendar.timeInMillis)
}, calendar.get(Calendar.HOUR_OF_DAY), calendar.get(Calendar.MINUTE), DateFormat.is24HourFormat(this)) }, calendar.get(Calendar.HOUR_OF_DAY), calendar.get(Calendar.MINUTE), DateFormat.is24HourFormat(this))
.show() .show()
}, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH)).show() }, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH)).show()
// On some devices, the keyboard can cover the date picker // On some devices, the keyboard can cover the date picker
@@ -628,7 +635,7 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
override fun requestContact() { override fun requestContact() {
val intent = Intent(Intent.ACTION_PICK) val intent = Intent(Intent.ACTION_PICK)
.setType(ContactsContract.Contacts.CONTENT_TYPE) .setType(ContactsContract.Contacts.CONTENT_TYPE)
startActivityForResult(Intent.createChooser(intent, null), ComposeView.AttachContactRequestCode) startActivityForResult(Intent.createChooser(intent, null), ComposeView.AttachContactRequestCode)
} }
@@ -637,21 +644,22 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
message.hideKeyboard() message.hideKeyboard()
val serialized = HashMap(chips.associate { chip -> chip.address to chip.contact?.lookupKey }) val serialized = HashMap(chips.associate { chip -> chip.address to chip.contact?.lookupKey })
val intent = Intent(this, ContactsActivity::class.java) val intent = Intent(this, ContactsActivity::class.java)
.putExtra(ContactsActivity.SharingKey, sharing) .putExtra(ContactsActivity.SharingKey, sharing)
.putExtra(ContactsActivity.ChipsKey, serialized) .putExtra(ContactsActivity.ChipsKey, serialized)
startActivityForResult(intent, ComposeView.SelectContactRequestCode) startActivityForResult(intent, ComposeView.SelectContactRequestCode)
} }
override fun startSpeechRecognition() { override fun startSpeechRecognition() {
startActivityForResult( if (!isSpeechRecognitionAvailable()) {
Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH).putExtra( val intent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH).apply {
RecognizerIntent.EXTRA_LANGUAGE_MODEL, putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM)
RecognizerIntent.LANGUAGE_MODEL_FREE_FORM }
), try {
// include below if want a custom message that the STT can (optionally) display startActivityForResult(intent, ComposeView.SpeechRecognitionRequestCode)
// .putExtra(RecognizerIntent.EXTRA_PROMPT, "Speak your message") } catch (e: ActivityNotFoundException) {
ComposeView.SpeechRecognitionRequestCode Toast.makeText(this, getString(R.string.stt_toast_no_provider), Toast.LENGTH_SHORT).show()
) }
}
} }
override fun themeChanged() { override fun themeChanged() {
@@ -666,21 +674,21 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
override fun requestCamera() { override fun requestCamera() {
cameraDestination = SimpleDateFormat("yyyyMMdd_HHmmss", Locale.getDefault()).format(Date()) cameraDestination = SimpleDateFormat("yyyyMMdd_HHmmss", Locale.getDefault()).format(Date())
.let { timestamp -> ContentValues().apply { put(MediaStore.Images.Media.TITLE, timestamp) } } .let { timestamp -> ContentValues().apply { put(MediaStore.Images.Media.TITLE, timestamp) } }
.let { cv -> contentResolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, cv) } .let { cv -> contentResolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, cv) }
val intent = Intent(MediaStore.ACTION_IMAGE_CAPTURE) val intent = Intent(MediaStore.ACTION_IMAGE_CAPTURE)
.putExtra(MediaStore.EXTRA_OUTPUT, cameraDestination) .putExtra(MediaStore.EXTRA_OUTPUT, cameraDestination)
startActivityForResult(Intent.createChooser(intent, null), ComposeView.TakePhotoRequestCode) startActivityForResult(Intent.createChooser(intent, null), ComposeView.TakePhotoRequestCode)
} }
override fun requestGallery(mimeType: String, requestCode: Int) { override fun requestGallery(mimeType: String, requestCode: Int) {
val intent = Intent(Intent.ACTION_PICK) val intent = Intent(Intent.ACTION_PICK)
.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true) .putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true)
.addFlags(Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION) .addFlags(Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION)
.putExtra(Intent.EXTRA_LOCAL_ONLY, false) .putExtra(Intent.EXTRA_LOCAL_ONLY, false)
.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) .addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
.setType(mimeType) .setType(mimeType)
startActivityForResult(Intent.createChooser(intent, null), requestCode) startActivityForResult(Intent.createChooser(intent, null), requestCode)
} }
@@ -691,9 +699,9 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
override fun scrollToMessage(id: Long) { override fun scrollToMessage(id: Long) {
messageAdapter.data?.second messageAdapter.data?.second
?.indexOfLast { message -> message.id == id } ?.indexOfLast { message -> message.id == id }
?.takeIf { position -> position != -1 } ?.takeIf { position -> position != -1 }
?.let(messageList::scrollToPosition) ?.let(messageList::scrollToPosition)
} }
override fun showQksmsPlusSnackbar(message: Int) { override fun showQksmsPlusSnackbar(message: Int) {
@@ -707,11 +715,11 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
override fun showDeleteDialog(messages: List<Long>) { override fun showDeleteDialog(messages: List<Long>) {
val count = messages.size val count = messages.size
android.app.AlertDialog.Builder(this) android.app.AlertDialog.Builder(this)
.setTitle(R.string.dialog_delete_title) .setTitle(R.string.dialog_delete_title)
.setMessage(resources.getQuantityString(R.plurals.dialog_delete_chat, count, count)) .setMessage(resources.getQuantityString(R.plurals.dialog_delete_chat, count, count))
.setPositiveButton(R.string.button_delete) { _, _ -> confirmDeleteIntent.onNext(messages) } .setPositiveButton(R.string.button_delete) { _, _ -> confirmDeleteIntent.onNext(messages) }
.setNegativeButton(R.string.button_cancel, null) .setNegativeButton(R.string.button_cancel, null)
.show() .show()
} }
override fun showClearCurrentMessageDialog() { override fun showClearCurrentMessageDialog() {
@@ -761,8 +769,8 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
when (requestCode) { when (requestCode) {
ComposeView.SelectContactRequestCode -> { ComposeView.SelectContactRequestCode -> {
chipsSelectedIntent.onNext(data?.getSerializableExtra(ContactsActivity.ChipsKey) chipsSelectedIntent.onNext(data?.getSerializableExtra(ContactsActivity.ChipsKey)
?.let { serializable -> serializable as? HashMap<String, String?> } ?.let { serializable -> serializable as? HashMap<String, String?> }
?: hashMapOf()) ?: hashMapOf())
} }
ComposeView.TakePhotoRequestCode -> { ComposeView.TakePhotoRequestCode -> {
@@ -563,4 +563,6 @@
<string name="messageLinkHandling_dialog_body">Some links may be unsafe or redirect you unexpectedly. Review the link below before proceeding:\n\n%1$s\n\nDo you want to continue?</string> <string name="messageLinkHandling_dialog_body">Some links may be unsafe or redirect you unexpectedly. Review the link below before proceeding:\n\n%1$s\n\nDo you want to continue?</string>
<string name="messageLinkHandling_dialog_positive">Yes, open the link</string> <string name="messageLinkHandling_dialog_positive">Yes, open the link</string>
<string name="messageLinkHandling_dialog_negative">No</string> <string name="messageLinkHandling_dialog_negative">No</string>
<string name="stt_toast_no_provider">No speech-to-text service available</string>
<string name="stt_toast_extra_prompt">Speak your message</string>
</resources> </resources>