Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V4.1.4 - GridLayoutManager在过渡为状态布局时会导致 ItemDecoration 失效 #6695

Open
Chen-Xi-g opened this issue Nov 13, 2024 · 0 comments

Comments

@Chen-Xi-g
Copy link

  1. 当前使用的版本号: 4.1.4
  2. 复现操作描述:
    1. RecyclerView使用GridLayoutManager/QuickGridLayoutManager(StaggeredGridLayoutManager没有尝试,但预估会发生同样的问题), 添加ItemDecoration
    2. 启用状态布局, 并设置状态布局
    3. 调用submitList(emptyList())设置数据为空
    4. 此时会发生ItemDecoration被清空的情况.
  3. 已经Fork项目, 并在已创建出现问题的代码, 请查看链接: https://github.com/Chen-Xi-g/BaseRecyclerViewAdapterHelper
  4. 复现视频
RFCMA04RTAE_20241113_164516_916.mp4

问题发生在调用submitList之后调用了notifyItemRangeRemoved,

open fun submitList(list: List<T>?) {
    // ......
    if (newDisplayEmptyLayout && !oldDisplayEmptyLayout) {
        notifyItemRangeRemoved(0, items.size)
        items = newList
        notifyItemInserted(0)
    } // ......
}
@Chen-Xi-g Chen-Xi-g changed the title GridLayoutManager在刷新的时候会导致 ItemDecoration 失效 GridLayoutManager在过渡为状态布局时会导致 ItemDecoration 失效 Nov 13, 2024
@Chen-Xi-g Chen-Xi-g changed the title GridLayoutManager在过渡为状态布局时会导致 ItemDecoration 失效 V4.1.4 - GridLayoutManager在过渡为状态布局时会导致 ItemDecoration 失效 Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant