small changes
This commit is contained in:
		| @ -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() | ||||
|             ) | ||||
|         } | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user