clean up.

This commit is contained in:
2020-08-20 00:16:19 +02:00
parent 1a2a724bb2
commit e88871172e
8 changed files with 17 additions and 99 deletions

View File

@@ -2,26 +2,18 @@ package me.zobrist.tichucounter
import android.app.AlertDialog
import android.content.Context
import android.content.SharedPreferences
import android.os.Bundle
import android.text.InputType
import android.view.Menu
import android.view.MenuItem
import android.widget.ScrollView
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatDelegate
import androidx.core.widget.doOnTextChanged
import kotlinx.android.synthetic.main.content_main.*
import android.text.InputType
import android.widget.ScrollView
import androidx.appcompat.app.AppCompatDelegate
class MainActivity : AppCompatActivity() {
private var listA: List<Int> = emptyList()
private var listB: List<Int> = emptyList()
private var counterTeamA: Int = 0
private var counterTeamB: Int = 0
private var invertA: Boolean = false
private var invertB: Boolean = false
@@ -186,7 +178,7 @@ class MainActivity : AppCompatActivity() {
}
buttonInv.setOnClickListener {
var tempInt: Int
val tempInt: Int
if(inputTeamA.isFocused ){
@@ -213,13 +205,13 @@ class MainActivity : AppCompatActivity() {
buttonBack.setOnClickListener{
if(inputTeamA.isFocused ){
if(inputTeamA.text.isNotEmpty()){
var string = inputTeamA.text.toString()
val string = inputTeamA.text.toString()
inputTeamA.setText(string.substring(0, string.length -1))
}
}else if(inputTeamB.isFocused) {
if(inputTeamB.text.isNotEmpty()) {
var string = inputTeamB.text.toString()
val string = inputTeamB.text.toString()
inputTeamB.setText(string.substring(0, string.length - 1))
}
}
@@ -332,9 +324,9 @@ class MainActivity : AppCompatActivity() {
builder.setTitle(getString(R.string.choose_theme_text))
val styles = arrayOf("Light","Dark","System default")
var checkedItem = this.getSharedPreferences("", Context.MODE_PRIVATE).getInt("Theme", 2)
val checkedItem = this.getSharedPreferences("", Context.MODE_PRIVATE).getInt("Theme", 2)
var prefs = this.getSharedPreferences("Settings", Context.MODE_PRIVATE).edit()
val prefs = this.getSharedPreferences("Settings", Context.MODE_PRIVATE).edit()
builder.setSingleChoiceItems(styles, checkedItem) { dialog, which ->