CymChad / CymChad/BaseRecyclerViewAdapterHelper
BaseNodeAdapter
Open
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
- 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 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