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 }