improvements
This commit is contained in:
@@ -156,23 +156,19 @@ class MatchActivity : AppCompatActivity() {
|
||||
hashMapOf(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID to "Victory")
|
||||
)
|
||||
} else {
|
||||
var scoreSpeech: String = getString(
|
||||
R.string.update_score_speech,
|
||||
players[serviceSide].score,
|
||||
players[relaunchSide].score,
|
||||
players[serviceSide].name
|
||||
)
|
||||
if (matchPoint)
|
||||
scoreSpeech += getString(R.string.match_point)
|
||||
tts?.speak(
|
||||
getString(
|
||||
R.string.update_score_speech,
|
||||
players[serviceSide].score,
|
||||
players[relaunchSide].score,
|
||||
players[serviceSide].name
|
||||
),
|
||||
scoreSpeech,
|
||||
TextToSpeech.QUEUE_FLUSH,
|
||||
hashMapOf(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID to "MessageId")
|
||||
)
|
||||
if (matchPoint) {
|
||||
tts?.speak(
|
||||
getString(R.string.match_point),
|
||||
TextToSpeech.QUEUE_ADD,
|
||||
hashMapOf(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID to "MessageId")
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ import android.view.View
|
||||
import android.widget.ArrayAdapter
|
||||
import android.widget.GridView
|
||||
import android.widget.TextView
|
||||
import kotlin.math.max
|
||||
import kotlin.math.min
|
||||
|
||||
|
||||
class VictoryActivity : AppCompatActivity() {
|
||||
@@ -46,12 +48,13 @@ class VictoryActivity : AppCompatActivity() {
|
||||
putString(
|
||||
"previousMatches",
|
||||
getString(
|
||||
R.string.result,
|
||||
R.string.results,
|
||||
players[0].name,
|
||||
players[0].score,
|
||||
players[1].score,
|
||||
players[1].name
|
||||
) + previousMatches
|
||||
players[1].name,
|
||||
previousMatches
|
||||
)
|
||||
)
|
||||
commit()
|
||||
}
|
||||
@@ -101,8 +104,8 @@ class VictoryActivity : AppCompatActivity() {
|
||||
players[0].name,
|
||||
players[1].name,
|
||||
winnerName,
|
||||
players[0].score,
|
||||
players[1].score
|
||||
max(players[0].score, players[1].score),
|
||||
min(players[0].score, players[1].score)
|
||||
)
|
||||
)
|
||||
type = "text/plain"
|
||||
|
||||
Reference in New Issue
Block a user