recyclerlistview icon indicating copy to clipboard operation
recyclerlistview copied to clipboard

better optimizeForInsertDeleteAnimations and fix stableId collision

Open LVBK opened this issue 4 years ago • 6 comments

This PR try to prevent RLV recycler too hard. I try to use RLV and react-native-reanimated (Transitioning.View) for cool list animation (fade in, fade out, move) But original RLV with optimizeForInsertDeleteAnimations not help 100% When new item with new stableId come in. Sometimes, RLV try to recycle with old render key so animation is Transition.Change, not Transition.In So, my core idea. every time dataSource change. I will clear recyclePool. It will prevent reuse old render key, new item will mount in (not update). It also help stableId collision.

DataProvider.cloneWithRows with 3rd optinal parameter optimizeForInsertAtBottomAnimation = true will try to _requiresDataChangeHandling when dataSource have something new item added to bottom of RLV (load more) So _requiresDataChangeHandling = true will trigger VirtualRenderer.handleDataSetChange and prevent recycle items at top of RLV (Prevent top down move animation).

Now i'm happy with RLV and react-native-reanimated and goodbye Flatlist :)

LVBK avatar Mar 12 '20 05:03 LVBK

@LVBK @naqvitalha when this will be avaliable for use? Struggling with stable id collision issue.

davx1992 avatar May 13 '20 11:05 davx1992

This is improtant fix, which is removing issue with stable ids, any plan to merge this?

davx1992 avatar Jan 15 '21 17:01 davx1992

I totally agree. Its great to have an itemAnimator and an optimizeForInsertDelete functionality but if the stableId issue has not been resolved yet then we cant animate inserts correctly.

A little guidance on when/if this is going to be merged would be greatly appreciated.

mdarke1 avatar Mar 04 '21 10:03 mdarke1

Just to be clear - this is an issue of the itemAnimator for inserting/deleting failing to work once scrolling is enacted.

mdarke1 avatar Mar 08 '21 04:03 mdarke1

@naqvitalha any plans to merge this?

timurridjanovic avatar Jul 27 '21 18:07 timurridjanovic

Any updates?

AlexSirenko avatar Jun 28 '22 10:06 AlexSirenko