|
|
|
@ -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 { |
|
|
|
|