CymChad / CymChad/BaseRecyclerViewAdapterHelper

3.0.4版本子view不响应问题

Open
#3,506 4 comments 1 reaction 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,版本:3.0.4
2,问题描述:
在BaseQuickAdapter的convert()方法中添加addChildClickViewIds()子view点击,不起作用。
3,产生的原因:
添加点击事件是在onCreateViewHolder();向childClickViewIds集合中添加子view是在convert();convert()是在onBindViewHolder();中调用,导致子view的集合为空
4,解决办法:
重写onCreateDefViewHolder();在这个方法中调用addChildClickViewIds()

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 BaseQuickAdapter through onCreateViewHolder(), onBindViewHolder(), convert(), and onCreateDefViewHolder(). Verify when childClickViewIds is populated relative to child click setup, then confirm the behavior with the reported 3.0.4 usage; done means child-view clicks respond without requiring an unexpected override.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.