From 7214d9c66691bf8cd6b3c8d5303d644b3f8da56a Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Wed, 28 Aug 2024 13:34:46 -0300 Subject: [PATCH] Don't allow app selection toggles before icons have loaded --- .../stevesoltys/seedvault/restore/AppSelectionAdapter.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/stevesoltys/seedvault/restore/AppSelectionAdapter.kt b/app/src/main/java/com/stevesoltys/seedvault/restore/AppSelectionAdapter.kt index 499184e8..499e1d8e 100644 --- a/app/src/main/java/com/stevesoltys/seedvault/restore/AppSelectionAdapter.kt +++ b/app/src/main/java/com/stevesoltys/seedvault/restore/AppSelectionAdapter.kt @@ -144,9 +144,6 @@ internal class AppSelectionAdapter( fun bind(item: SelectableAppItem) { v.background = clickableBackground - v.setOnClickListener { - checkBox.toggle() - } checkBox.setOnCheckedChangeListener(null) checkBox.isChecked = item.selected @@ -155,6 +152,11 @@ internal class AppSelectionAdapter( } checkBox.visibility = if (item.hasIcon == null) INVISIBLE else VISIBLE progressBar.visibility = if (item.hasIcon == null) VISIBLE else INVISIBLE + if (item.hasIcon == null) { + v.setOnClickListener(null) + } else v.setOnClickListener { + checkBox.toggle() + } val isSpecial = item.metadata.isInternalSystem appIcon.scaleType = FIT_CENTER