some changes
This commit is contained in:
parent
512151d69c
commit
de4ff89233
@ -1,6 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="adrienmalin.pingpoints">
|
package="adrienmalin.pingpoints">
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
|
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
|
||||||
|
|
||||||
<application
|
<application
|
||||||
|
@ -195,6 +195,9 @@ class MatchActivity : AppCompatActivity() {
|
|||||||
players[1].name
|
players[1].name
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
putExtra(
|
||||||
|
RecognizerIntent.EXTRA_MAX_RESULTS, 10
|
||||||
|
)
|
||||||
},
|
},
|
||||||
REQ_CODE_SPEECH_INPUT
|
REQ_CODE_SPEECH_INPUT
|
||||||
)
|
)
|
||||||
@ -217,7 +220,8 @@ class MatchActivity : AppCompatActivity() {
|
|||||||
matchModel?.apply {
|
matchModel?.apply {
|
||||||
if (resultCode == RESULT_OK && data != null) {
|
if (resultCode == RESULT_OK && data != null) {
|
||||||
var understood: Boolean = false
|
var understood: Boolean = false
|
||||||
val result: String = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS)[0]
|
val results: ArrayList<String> = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS)
|
||||||
|
for (result in results) {
|
||||||
for (player in players) {
|
for (player in players) {
|
||||||
if (player.pattern?.matcher(result)?.find() == true) {
|
if (player.pattern?.matcher(result)?.find() == true) {
|
||||||
understood = true
|
understood = true
|
||||||
@ -226,6 +230,8 @@ class MatchActivity : AppCompatActivity() {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (understood) break
|
||||||
|
}
|
||||||
if (!understood) {
|
if (!understood) {
|
||||||
if (ttsEnabled) {
|
if (ttsEnabled) {
|
||||||
tts?.speak(
|
tts?.speak(
|
||||||
|
@ -32,8 +32,8 @@
|
|||||||
<string name="share_subject">Match Ping Points : %s contre %s</string>
|
<string name="share_subject">Match Ping Points : %s contre %s</string>
|
||||||
<string name="share_message">"%s contre %s:\n%s a gagné par %d à %d\nPing Points est disponible sur Google Play\n "</string>
|
<string name="share_message">"%s contre %s:\n%s a gagné par %d à %d\nPing Points est disponible sur Google Play\n "</string>
|
||||||
<string name="match_point">Balle de match</string>
|
<string name="match_point">Balle de match</string>
|
||||||
<string name="STT_hint">Dîtes : \"%s\" ou \"%s\"</string>
|
<string name="STT_hint">Dîtes : \"Point pour %s\"\nou \"Point pour %s\"</string>
|
||||||
<string name="pattern">(?i:%s)</string>
|
<string name="pattern">(?i:Point pour %s)</string>
|
||||||
<string name="not_understood">Pouvez-vous répéter ?</string>
|
<string name="not_understood">Pouvez-vous répéter ?</string>
|
||||||
<string name="STT_disabled">Reconnaissance vocale désactivée.</string>
|
<string name="STT_disabled">Reconnaissance vocale désactivée.</string>
|
||||||
</resources>
|
</resources>
|
@ -37,8 +37,8 @@
|
|||||||
<string name="share_subject">Ping Points Match: %s vs. %s</string>
|
<string name="share_subject">Ping Points Match: %s vs. %s</string>
|
||||||
<string name="share_message">%s vs. %s:\n%s won by %d to %d\nGet Ping Points on Google Play</string>
|
<string name="share_message">%s vs. %s:\n%s won by %d to %d\nGet Ping Points on Google Play</string>
|
||||||
<string name="match_point">Match point</string>
|
<string name="match_point">Match point</string>
|
||||||
<string name="STT_hint">Say: \"%s\" or \"%s\"</string>
|
<string name="STT_hint">Say: \"Point for %s\"\nor \"Point for %s\"</string>
|
||||||
<string name="pattern">(?i:%s)</string>
|
<string name="pattern">(?i:Point for %s)</string>
|
||||||
<string name="not_understood">Can you repeat, please?</string>
|
<string name="not_understood">Can you repeat, please?</string>
|
||||||
<string name="score" translatable="false">%d - %d</string>
|
<string name="score" translatable="false">%d - %d</string>
|
||||||
<string name="STT_disabled">Voice recognition disabled.</string>
|
<string name="STT_disabled">Voice recognition disabled.</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user