Skip to content

Commit

Permalink
Attempt to fix checkbox again
Browse files Browse the repository at this point in the history
  • Loading branch information
levinli303 committed Mar 30, 2023
1 parent 9ebb1b8 commit 22eddc9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:installLocation="auto"
android:versionCode="357"
android:versionCode="358"
android:versionName="1.5.20">

<uses-feature android:name="android.hardware.type.pc" android:required="false" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
Expand Down

0 comments on commit 22eddc9

Please sign in to comment.