Commit e0153557 by likorn

Fixed the bug with saving values

parent d6d9a2b4
...@@ -36,6 +36,7 @@ class MainActivity : AppCompatActivity() { ...@@ -36,6 +36,7 @@ class MainActivity : AppCompatActivity() {
val cardM = card as MaterialCardView val cardM = card as MaterialCardView
if (!cardM.isChecked) { if (!cardM.isChecked) {
cardM.isChecked = true cardM.isChecked = true
checkedCard = cardM
numDigits = getTextView(card).text.toString().toInt() numDigits = getTextView(card).text.toString().toInt()
listOf(card_2_digits, card_3_digits, card_4_digits).forEach { c -> listOf(card_2_digits, card_3_digits, card_4_digits).forEach { c ->
if (c.id != cardM.id) if (c.id != cardM.id)
...@@ -56,6 +57,7 @@ class MainActivity : AppCompatActivity() { ...@@ -56,6 +57,7 @@ class MainActivity : AppCompatActivity() {
private fun saveSelectedValues() { private fun saveSelectedValues() {
val editor = getSharedPreferences("my_prefs", Context.MODE_PRIVATE).edit() val editor = getSharedPreferences("my_prefs", Context.MODE_PRIVATE).edit()
editor.putInt("sec_to_solve", secToSolve) editor.putInt("sec_to_solve", secToSolve)
editor.putInt("checked_num_id", checkedCard.id)
editor.apply() editor.apply()
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment