Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
821938089 committed Dec 21, 2024
1 parent d4f5115 commit 3b9f8cc
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ class BookSourceAdapter(context: Context, val callBack: CallBack) :
payloads: MutableList<Any>
) {
binding.run {
upSourceHost(binding, holder.layoutPosition)
if (payloads.isEmpty()) {
root.setBackgroundColor(ColorUtils.withAlpha(context.backgroundColor, 0.5f))
cbBookSource.text = item.getDisPlayNameGroup()
swtEnabled.isChecked = item.enabled
cbBookSource.isChecked = selected.contains(item)
upCheckSourceMessage(binding, item)
upShowExplore(ivExplore, item)
upSourceHost(binding, holder.layoutPosition)
} else {
for (i in payloads.indices) {
val bundle = payloads[i] as Bundle
Expand All @@ -109,6 +109,7 @@ class BookSourceAdapter(context: Context, val callBack: CallBack) :
"upExplore" -> upShowExplore(ivExplore, item)
"selected" -> cbBookSource.isChecked = selected.contains(item)
"checkSourceMessage" -> upCheckSourceMessage(binding, item)
"upSourceHost" -> upSourceHost(binding, holder.layoutPosition)
}
}
}
Expand Down Expand Up @@ -151,6 +152,9 @@ class BookSourceAdapter(context: Context, val callBack: CallBack) :

override fun onCurrentListChanged() {
callBack.upCountView()
if (showSourceHost) {
notifyItemRangeChanged(0, itemCount, bundleOf("upSourceHost" to null))
}
}

private fun showMenu(view: View, position: Int) {
Expand Down

0 comments on commit 3b9f8cc

Please sign in to comment.