CymChad / CymChad/BaseRecyclerViewAdapterHelper

2.9.22---2.9.50 使用BaseMultiItemQuickAdapter 上拉加载不能展示加载状态(加载中、没有更多数据等)

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

使用BaseMultiItemQuickAdapter ,然后用默认自带的上拉加载功能

上拉加载可以正常触发,就是不展示状态,BaseQuickAdapter是正常的

通过查看源码发现 BaseMultiItemQuickAdapter 重写了getItemViewType方法,然后并没有添加或保留父类的header或footer

我估计是这个问题导致的。

@Override
protected int getDefItemViewType(int position) {
    Object item = mData.get(position);
    if (item instanceof MultiItemEntity) {
        return ((MultiItemEntity) item).getItemType();
    }
    return DEFAULT_VIEW_TYPE;
}

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 BaseMultiItemQuickAdapter and its getItemViewType override, then compare it with BaseQuickAdapter, where load-more states work. Verify how header and footer view types are handled; done means the loading, no-more-data, and related states render when using the multi-item adapter.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
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.