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

修改BaseNodeAdapter收起时删除超多数据量卡顿问题 #3459

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Roc-egg
Copy link

@Roc-egg Roc-egg commented Apr 15, 2021

当折叠类型的adapter二级视图添加几十万个数据时,收起时会因为this.data.removeAll(items)耗时严重导致出现卡死问题

@Dboy233
Copy link

Dboy233 commented Apr 15, 2021

直接在源数据上移除,然后notifyDataSetChanged()呢。

@Roc-egg
Copy link
Author

Roc-egg commented Apr 15, 2021

直接在源数据上可移除,然后notifyDataSetChanged()呢。

那样可以但是你会刷新所有数据,并且不能使用BaseNodeAdapter的折叠动画,使用notifyItemRangeRemoved也可以,我目前是折叠点击把源码里面的代码拿出来做修改的,等同于调用expandOrCollapse

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

Successfully merging this pull request may close these issues.

2 participants