Skip to content

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