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