CymChad / CymChad/BaseRecyclerViewAdapterHelper

BaseBinderAdapter GridLayoutManager使用问题

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

BaseBinderAdapter

        GridLayoutManager gridLayoutManager = new GridLayoutManager(mContext, 3);
        mAdapter.setGridSpanSizeLookup(new GridSpanSizeLookup() {
            @Override
            public int getSpanSize(@NonNull GridLayoutManager gridLayoutManager, int viewType, int position) {
                return 1;
            }
        });

getSpanSize 那个方法怎么返回?mAdapter.setList() 添加的数据是一个List《Object> ,在 List《Object> 中添加的每一个Bean 对象 都需要添加一个spanSize 的值吗?在getSpanSize 拿到 List《Object> 中所有的数据,强转之后 在获取spanSize吗?有多种类型就要强转多次,请问还没有其他的方式。

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 BaseBinderAdapter's setGridSpanSizeLookup and GridSpanSizeLookup, then trace how setList supplies items to the lookup. Determine whether the existing APIs support mixed item types without extra model data or casts. Done means the issue has a concrete, documented approach or a clearly scoped API change.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.