CymChad / CymChad/BaseRecyclerViewAdapterHelper

BaseNodeAdapter

Open
#3,638 0 comments 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

如何删除父节点,我为父节点设置 setOnItemChildClickListener,当我列表中只有一个父节点时,我去删除父节点报错,outofboundindex 错误,跟踪代码到
` // 先移除子项
removeCount = removeChildAt(position)

    // 移除node自己
    this.data.removeAt(position)
    removeCount += 1
    //这一步报错,我没有设置脚部,结果报错了
    val node = this.data[position]
    // 移除脚部
    if (node is NodeFooterImp && node.footerNode != null) {
        this.data.removeAt(position)
        removeCount += 1
    }
    return removeCount`

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 in BaseNodeAdapter at the parent-removal sequence shown in the issue, especially removeChildAt(position) and the later data[position] access. Reproduce it with one parent node, setOnItemChildClickListener, and no footer. Done means deleting that parent no longer raises an outofboundindex error.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.