diff --git a/presentation/src/main/AndroidManifest.xml b/presentation/src/main/AndroidManifest.xml index e0b5e198..5840f75a 100644 --- a/presentation/src/main/AndroidManifest.xml +++ b/presentation/src/main/AndroidManifest.xml @@ -275,6 +275,9 @@ + + + diff --git a/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeActivity.kt b/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeActivity.kt index f4bb4c16..0143152c 100644 --- a/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeActivity.kt +++ b/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeActivity.kt @@ -566,11 +566,12 @@ class ComposeActivity : QkThemedActivity(), ComposeView { if (state.scheduling) scheduleAction.onNext(true) - if (prefs.showStt.get()) { + // if stt is available and preference is set to show stt button + if (isSpeechRecognitionAvailable() && prefs.showStt.get()) { speechToTextFrame.isVisible = true - var xPercent = prefs.showSttOffsetX.get() - var yPercent = prefs.showSttOffsetY.get() + val xPercent = prefs.showSttOffsetX.get() + val yPercent = prefs.showSttOffsetY.get() // if the stt icon has a custom position, move it if ((xPercent != Float.MAX_VALUE) && (yPercent != Float.MAX_VALUE)) { @@ -676,7 +677,7 @@ class ComposeActivity : QkThemedActivity(), ComposeView { } override fun startSpeechRecognition() { - if (!isSpeechRecognitionAvailable()) { + if (isSpeechRecognitionAvailable()) { val intent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH).apply { putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM) }