CymChad / CymChad/BaseRecyclerViewAdapterHelper

使用BaseNodeProvider创建多个节点 怎么获取子节点的item再子节点的位置

Open
#3,295 5 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

比如第一个FirstNode已经展开 里面有5个SecondNode,此时点击第一个SecondNode,返回的position是1,但是我想要的是secondNode在本树里面的位置,而不是在总树里面的位置
再比如第一个FirstNode已经展开,里面5个SecondNode,第二个FirstNode也已经展开,此时点击第二个firstnode的第一个secondnode,此时返回的position是7(他是总item里面的第八个),但是我此时想要的数字是0(因为他在第二个节点里面的位置是第一位)

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 with the BaseNodeProvider position handling described in the issue and trace how child nodes receive their positions when multiple FirstNode items are expanded. Confirm whether the intended result is each child’s index within its parent, then document or test the expected positions for both examples before deciding what change is needed.

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.