|
|
|
@ -117,6 +117,7 @@ class BookSourceAdapter(context: Context, val callBack: CallBack) : |
|
|
|
|
override fun registerListener(holder: ItemViewHolder, binding: ItemBookSourceBinding) { |
|
|
|
|
binding.apply { |
|
|
|
|
swtEnabled.setOnCheckedChangeListener { view, checked -> |
|
|
|
|
if (view.isPressed) { |
|
|
|
|
getItem(holder.layoutPosition)?.let { |
|
|
|
|
if (view.isPressed) { |
|
|
|
|
it.enabled = checked |
|
|
|
@ -124,7 +125,9 @@ class BookSourceAdapter(context: Context, val callBack: CallBack) : |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
cbBookSource.setOnCheckedChangeListener { view, checked -> |
|
|
|
|
if (view.isPressed) { |
|
|
|
|
getItem(holder.layoutPosition)?.let { |
|
|
|
|
if (view.isPressed) { |
|
|
|
|
if (checked) { |
|
|
|
@ -136,6 +139,7 @@ class BookSourceAdapter(context: Context, val callBack: CallBack) : |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
ivEdit.onClick { |
|
|
|
|
getItem(holder.layoutPosition)?.let { |
|
|
|
|
callBack.edit(it) |
|
|
|
|