react-native-sortable-listview icon indicating copy to clipboard operation
react-native-sortable-listview copied to clipboard

Reorder with animation

Open obetomuniz opened this issue 6 years ago • 8 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 avatar Mar 22 '18 04:03 obetomuniz

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

ilonashub avatar Apr 10 '18 16:04 ilonashub

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

obetomuniz avatar Apr 10 '18 17:04 obetomuniz

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

nihgwu avatar Apr 11 '18 03:04 nihgwu

@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 avatar Apr 11 '18 07:04 ilonashub

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

nihgwu avatar Apr 11 '18 08:04 nihgwu

@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

ilonashub avatar Apr 11 '18 09:04 ilonashub

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 avatar Apr 11 '18 09:04 nihgwu

@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!

ilonashub avatar Apr 11 '18 11:04 ilonashub