Reformat Code
This commit is contained in:
@@ -249,7 +249,12 @@ class MainActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
if (inputTeamA.text.isNotEmpty() && inputTeamB.text.isNotEmpty()) {
|
if (inputTeamA.text.isNotEmpty() && inputTeamB.text.isNotEmpty()) {
|
||||||
|
|
||||||
history.logRound(Round(inputTeamA.text.toString().toInt(), inputTeamB.text.toString().toInt()))
|
history.logRound(
|
||||||
|
Round(
|
||||||
|
inputTeamA.text.toString().toInt(),
|
||||||
|
inputTeamB.text.toString().toInt()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
updateView()
|
updateView()
|
||||||
@@ -283,7 +288,19 @@ class MainActivity : AppCompatActivity() {
|
|||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
return when (item.itemId) {
|
return when (item.itemId) {
|
||||||
R.id.action_clear -> {
|
R.id.action_clear -> {
|
||||||
|
val builder = AlertDialog.Builder(this)
|
||||||
|
builder.setMessage(getString(R.string.confirmClear))
|
||||||
|
.setTitle(R.string.clear)
|
||||||
|
.setCancelable(false)
|
||||||
|
.setPositiveButton(getString(R.string.yes)) { dialog, id ->
|
||||||
|
dialog.dismiss()
|
||||||
clearAll()
|
clearAll()
|
||||||
|
}
|
||||||
|
.setNegativeButton(getString(R.string.no)) { dialog, id ->
|
||||||
|
dialog.cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
builder.create().show()
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
R.id.action_undo -> {
|
R.id.action_undo -> {
|
||||||
@@ -343,8 +360,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
inputTeamA.text.append(toAppend)
|
inputTeamA.text.append(toAppend)
|
||||||
}else if(inputTeamB.isFocused)
|
} else if (inputTeamB.isFocused) {
|
||||||
{
|
|
||||||
if (invertB) {
|
if (invertB) {
|
||||||
invertB = false
|
invertB = false
|
||||||
inputTeamB.text.append('-')
|
inputTeamB.text.append('-')
|
||||||
|
|||||||
Reference in New Issue
Block a user