From e8f4f8a7557842a1bb7cc450490ce355a9539574 Mon Sep 17 00:00:00 2001 From: Niko Diamadis Date: Mon, 27 Feb 2023 23:30:45 +0100 Subject: [PATCH] Fix ResourcesNotFoundException for background color --- .../main/kotlin/com/cyb3rko/pincredible/data/PinTable.kt | 8 ++++++-- .../cyb3rko/pincredible/fragments/PinCreatorFragment.kt | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/cyb3rko/pincredible/data/PinTable.kt b/app/src/main/kotlin/com/cyb3rko/pincredible/data/PinTable.kt index 4a3a4de..18d0841 100644 --- a/app/src/main/kotlin/com/cyb3rko/pincredible/data/PinTable.kt +++ b/app/src/main/kotlin/com/cyb3rko/pincredible/data/PinTable.kt @@ -24,11 +24,15 @@ internal class PinTable : Serializable { private lateinit var pattern: Array init { - reset() + resetDigits() + resetPattern() } - fun reset() { + fun resetDigits() { data = Array(ROW_COUNT) { IntArray(COLUMN_COUNT) { -1 } } + } + + private fun resetPattern() { pattern = Array(ROW_COUNT) { IntArray(COLUMN_COUNT) { -1 } } } diff --git a/app/src/main/kotlin/com/cyb3rko/pincredible/fragments/PinCreatorFragment.kt b/app/src/main/kotlin/com/cyb3rko/pincredible/fragments/PinCreatorFragment.kt index da1ee70..eed995c 100644 --- a/app/src/main/kotlin/com/cyb3rko/pincredible/fragments/PinCreatorFragment.kt +++ b/app/src/main/kotlin/com/cyb3rko/pincredible/fragments/PinCreatorFragment.kt @@ -233,7 +233,7 @@ class PinCreatorFragment : Fragment() { private fun clearTable() { binding.fab.hide() - pinTable.reset() + pinTable.resetDigits() binding.tableLayout.table.iterate { view, row, column -> ((view[row] as TableRow)[column] as TextView).text = null }