CymChad / CymChad/BaseRecyclerViewAdapterHelper

关于remove(bean)方法卡顿

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

在做悬停时候,调用了remove(bean)方法去除悬停的布局。 滑动发生卡顿。
RecyclerView: Cannot call this method in a scroll callback. Scroll callbacks mightbe run during a measure & layout pass where you cannot change theRecyclerView data. Any method call that might change the structureof the
logcat中发现如下白色报错
报错版本::BaseRecyclerViewAdapterHelper:3.0.4
具体代码是在recycleview的OnScrollListener onScrolled方法中调用了
//下滑情况
if (dy > 0) {
if (firstVisibleItemPosition >= index) {
if (!tableLayout.isShown()) {
if (datas.contains(changeBean)) {
secondAdapter.remove(changeBean);
tableLayout.setVisibility(View.VISIBLE);
llTabContent.setVisibility(View.VISIBLE);
}
}
}

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

The report provides a RecyclerView.OnScrollListener.onScrolled snippet and identifies remove(bean) in BaseRecyclerViewAdapterHelper 3.0.4 as the trigger. Start by reproducing the scroll callback with the supplied code and inspect the adapter's remove behavior; done means the cause and expected project-side behavior are confirmed.

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
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.