deanmcpherson / react-native-sortable-listview

Drag drop capable wrapper of ListView for React Native

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reorder with animation

obetomuniz opened this issue · comments

Is it possible add animation when I update order property value?

I want to aniamate from [0,1,2] to [2,0,1].

@obetomuniz did you manage to make it work? I need the same functionality... thanks :)

Hey @ilonashub. Sadly I did not. I used this library to solve my problem

I think use can config LayoutAnimation right before you set the new state, I don't test it.

@obetomuniz thanks! that's the library I am trying to use as well, just having some flickering issues there.

@nihgwu we use LayoutAnimation today - but it works only on iOS

@ilonashub for Android you need add this line UIManager.setLayoutAnimationEnabledExperimental && UIManager.setLayoutAnimationEnabledExperimental(true); at the very beginning

@nihgwu thanks! I know - we have this line and we use LayoutAnimation in Android in many places - but specifically the swapping that works for lists with LayoutAnimation works on iOS and not Android

LayoutAnimation.easyInOut is only effective for the next state change, I suspect there is other render consumed that, if the RNTester's LayoutAnimation example works for you then I think it should work on this scenario too

@nihgwu now that I think about it.. maybe the order of renders is different between Android and iOS - and what you're saying might be the problem. I'll check that direction. thanks!