CymChad / CymChad/BaseRecyclerViewAdapterHelper
BaseBinderAdapter GridLayoutManager使用问题
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
- 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 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