I want to animate removal of items on removal from FlatList.
I have a custom card component as item in a FlatList. I am showing it vertically.
now, I want to animate the removal of item. item can be removed from any place/index.
Animation on removal is, item should hide and the items below should slide-up slowly. It should be smooth, I have done normal its not smooth. I am able to do the animation of opacity but the translateY is not working as required on card.
using below animation for hiding the deleted card:
Animated.timing(this.animation, {
toValue: 1,
duration: 600,
// easing: Easing.linear,
delay: this.props.index * 1000,
}).start();
const animatedStyle = {
opacity: this.animation,
// transform: [
// {
// translateY: this.animation.interpolate({
// inputRange: [0, 1],
// outputRange: [0, 300],
// }),
// },
// ],
}
in card render()
<Animated.View style={[animatedStyle]}>
......
// mycode
</Animated.View>
not able to control/animate the FlatList re-render/scroll/scroll-up behavior.
Can someone help me?