diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index cc538b67..81bc7640 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -13,7 +13,7 @@ diff --git a/app/src/main/java/space/celestia/mobilecelestia/settings/SettingsCommonRecyclerViewAdapter.kt b/app/src/main/java/space/celestia/mobilecelestia/settings/SettingsCommonRecyclerViewAdapter.kt index 5f18e6c7..9329b1e3 100644 --- a/app/src/main/java/space/celestia/mobilecelestia/settings/SettingsCommonRecyclerViewAdapter.kt +++ b/app/src/main/java/space/celestia/mobilecelestia/settings/SettingsCommonRecyclerViewAdapter.kt @@ -208,11 +208,11 @@ class SettingsCommonRecyclerViewAdapter( get() = itemView.findViewById(R.id.checkbox) fun configure(text:String, isChecked: Boolean, stateChangeCallback: (Boolean) -> Unit) { - checkbox.clearOnCheckedStateChangedListeners() + checkbox.setOnCheckedChangeListener(null) checkbox.text = text - checkbox.checkedState = if (isChecked) MaterialCheckBox.STATE_CHECKED else MaterialCheckBox.STATE_UNCHECKED - checkbox.addOnCheckedStateChangedListener { _, checked -> - stateChangeCallback(checked == MaterialCheckBox.STATE_CHECKED) + checkbox.isChecked = isChecked + checkbox.setOnCheckedChangeListener { _, checked -> + stateChangeCallback(checked) } } }