mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-22 21:58:53 +01:00
Update Comments
This commit is contained in:
@@ -220,7 +220,7 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
|
|||||||
.autoDisposable(scope())
|
.autoDisposable(scope())
|
||||||
}
|
}
|
||||||
private fun isSpeechRecognitionAvailable(): Boolean {
|
private fun isSpeechRecognitionAvailable(): Boolean {
|
||||||
// Check if there is a speech recognition service available
|
// Check if there is a speech recognition service available, in Android 13 and up
|
||||||
val intent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH)
|
val intent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH)
|
||||||
val packageManager = this.packageManager
|
val packageManager = this.packageManager
|
||||||
val activities: List<ResolveInfo>
|
val activities: List<ResolveInfo>
|
||||||
@@ -231,7 +231,7 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
|
|||||||
PackageManager.ResolveInfoFlags.of(PackageManager.MATCH_DEFAULT_ONLY.toLong())
|
PackageManager.ResolveInfoFlags.of(PackageManager.MATCH_DEFAULT_ONLY.toLong())
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
// else, pre-tiramisu versions
|
// else, pre-tiramisu/Android 13 and earlier
|
||||||
val intent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH)
|
val intent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH)
|
||||||
activities = packageManager.queryIntentActivities(intent, 0)
|
activities = packageManager.queryIntentActivities(intent, 0)
|
||||||
}
|
}
|
||||||
@@ -676,7 +676,6 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
|
|||||||
ComposeView.SpeechRecognitionRequestCode
|
ComposeView.SpeechRecognitionRequestCode
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
// Display a message or handle the lack of STT provider in a way that suits your app
|
|
||||||
Toast.makeText(this, getString(R.string.stt_toast_no_provider), Toast.LENGTH_SHORT).show()
|
Toast.makeText(this, getString(R.string.stt_toast_no_provider), Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user