Fix some problems in CompoundButtonFactory

This commit is contained in:
2023-02-03 03:39:05 +08:00
parent b478654008
commit 556951c27c

View File

@@ -38,8 +38,8 @@ fun CompoundButton.bind(data: PrefsData<Boolean>, initiate: CompoundButtonDataBi
binder.applyChangesCallback = { ConfigData.putBoolean(data, it) }
setOnCheckedChangeListener { button, isChecked ->
if (button.isPressed) {
binder.changedCallback?.invoke(isChecked)
if (binder.isAutoApplyChanges) binder.applyChangesCallback?.invoke(isChecked)
binder.changedCallback?.invoke(isChecked)
}
}
}