CymChad / CymChad/BaseRecyclerViewAdapterHelper
发现个bug
Open
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 24.6k
- Forks
- 5.2k
- PR merge metrics
- No merged PRs in 30d
Description
- 使用DataBinding, addChildClickViewIds()这个方法如果写在convert()中,会导致第一行的childView监听无效 ,问题出在源码第二行,绑listener早了点
else -> { val viewHolder = onCreateDefViewHolder(parent, viewType) bindViewClickListener(viewHolder, viewType) mDraggableModule?.initView(viewHolder) onItemViewHolderCreated(viewHolder, viewType) baseViewHolder = viewHolder }
2.为了能使listener生效,在我放在了
override fun createBaseViewHolder(view: View): BaseDataBindingHolder<ItemRoomManageBinding> { addChildClickViewIds(R.id.iv_delete) return super.createBaseViewHolder(view) }
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the adapter path containing onCreateDefViewHolder, bindViewClickListener, and mDraggableModule?.initView(viewHolder), then compare it with createBaseViewHolder and addChildClickViewIds(). Reproduce the DataBinding case where the first row's child listener is ineffective; done means child clicks work when the IDs are registered from the intended lifecycle point.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100