airbnb / epoxy

Epoxy is an Android library for building complex screens in a RecyclerView
https://goo.gl/eIK82p
Apache License 2.0
8.51k stars 728 forks source link

How to disable differ/ enable executing forceListOverride(list) publicly #1363

Open tsuellow opened 1 year ago

tsuellow commented 1 year ago

I am currently having issues when filtering a large list of items (aprox. 10000) through a searchterm on a Recyclerview. On startup the large list loads relatively quickly but when starting the filtering via searchString the differ + animations takes too long and make the app janky and even unresponsive at times. Disabling animations has already helped with the unresponsiveness but the differ calculations are performed regardless and make the recyclerView slow when it comes to rendering the filtered list ( I already verified that it is not the filtering itself that causes the lag). This improves significantly when the filtered list reduces in size as the searchterm becomes more specific but it becomes slow again as I reduce the search term specificity and the list grows again. I would like to disable, both animations and the differ calculations when the list of items is above a certain threshold and ideally reenable them once the filtering has reduced the list to a manageable size. I have found some methods that look like they could help me achieve this, like forceListOverride(list) found in the async differ class but they are private. I think it would make sense to forfeit the differ calculations entirely whenever animations are disabled