CymChad / CymChad/BaseRecyclerViewAdapterHelper

发现个bug

Open
#3,482 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
24.6k
Forks
5.2k
PR merge metrics
No merged PRs in 30d

Description

  1. 使用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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.