small changes
This commit is contained in:
parent
a6287e1760
commit
720795cfd6
@ -1,6 +1,7 @@
|
||||
package adrienmalin.pingpoints
|
||||
|
||||
data class Player (
|
||||
var name: String,
|
||||
var score: Int
|
||||
val name: String,
|
||||
var score: Int,
|
||||
val soundex: String = soundex(name)
|
||||
)
|
||||
|
@ -56,7 +56,7 @@ class SttDialog : DialogFragment() {
|
||||
if (matcher.find()) {
|
||||
val foundName = matcher.group(1)
|
||||
for (player in players) {
|
||||
if (soundex(foundName) == soundex(player.name)) {
|
||||
if (soundex(foundName) == player.soundex) {
|
||||
dismiss()
|
||||
updateScore(player)
|
||||
updateUI()
|
||||
|
@ -45,7 +45,7 @@ class VictoryActivity : AppCompatActivity() {
|
||||
intent.getIntExtra("player2Score", 0)
|
||||
)
|
||||
)
|
||||
previousMatch?.apply{ previousMatches = getString("previousMatches", "") }
|
||||
previousMatch?.apply{ previousMatches = getString("previousMatches", "") ?: "" }
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -64,7 +64,7 @@ class VictoryActivity : AppCompatActivity() {
|
||||
this@VictoryActivity,
|
||||
R.layout.grid_item,
|
||||
R.id.grid_item_text,
|
||||
previousMatches.split("\t|\n".toRegex())?.toMutableList()
|
||||
previousMatches.split("\t|\n".toRegex()).toMutableList()
|
||||
)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user