diff --git a/app/src/main/java/io/legado/app/ui/replace/ReplaceRuleAdapter.kt b/app/src/main/java/io/legado/app/ui/replace/ReplaceRuleAdapter.kt index 7b9be255c..51588e29f 100644 --- a/app/src/main/java/io/legado/app/ui/replace/ReplaceRuleAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/replace/ReplaceRuleAdapter.kt @@ -101,10 +101,12 @@ class ReplaceRuleAdapter(context: Context, var callBack: CallBack) : override fun registerListener(holder: ItemViewHolder, binding: ItemReplaceRuleBinding) { binding.apply { - swtEnabled.setOnCheckedChangeListener { _, isChecked -> - getItem(holder.layoutPosition)?.let { - it.isEnabled = isChecked - callBack.update(it) + swtEnabled.setOnCheckedChangeListener { buttonView, isChecked -> + if (buttonView.isPressed) { + getItem(holder.layoutPosition)?.let { + it.isEnabled = isChecked + callBack.update(it) + } } } ivEdit.onClick {