Advanced React Native FlatList animations at 60fps with Animated API
ฝัง
- เผยแพร่เมื่อ 11 ก.ค. 2024
- I decided to make another advanced FlatList #ReactNative animation video tutorial this time. This is an animated carousel/animated slider with lots of animations going on.
In this video tutorial we'll learn how to create:
- use the snapToInterval prop
- how to display a portion from the prev and next item
- how to align the active slide in the middle
- how to use MaskedView
Built using @expo, vanilla React Native Animated API and FlatList.
This code works in plain React Native project as well since we are using only React Native APIs such as Animated and FlatList.
- Inspiration: dribbble.com/shots/8257559-Mo...
- GitHub: github.com/catalinmiron/react...
👉👉👉 More react native animations: www.animatereactnative.com/ 👈👈👈
--
- Expo: expo.io/
- TMDB: www.themoviedb.org/
----
👉Join Discord: / discord .
Want to support me?
- Patreon: / catalinmiron
- BuyMeACoffee: www.buymeacoffee.com/catalinm...
- Paypal: paypal.me/catalinmiron
----
You can find me on:
- Github: github.com/catalinmiron
- Twitter: / mironcatalin
- Website: batman.codes
Timeline:
00:00 Intro
01:15 Project presentation
04:09 snapToInterval / decelerationRate
05:07 animate FlatList items
07:30 how to display the item in the middle snapToInterval
09:45 fix FlatList item animation
10:33 Create the backdrop
12:45 Backdrop FlatList
14:15 LinearGradient to fade the Backdrop
16:20 Animate Svg to create the parallax effect
18:53 60fps demonstration
19:26 Final words
#reactnative #animations #expo #tmdb
I received a lot of comments that this is not visible on Android devices. Here's the fix for it: snack.expo.io/@catalinmiron/react-native-movie-2.0-carousel-for-android. Thanks a ton!
having issues with this can i speak to you on twitter?
Still not working on Android.
Hi, in your example you use useNativeDriver: false. It is too slow on my device. Do you have any solution with useNativeDriver: true for android ?
I have managed to try and works on android, don't know the implication but I make the { useNativeDriver:false} in Animate.Flatlist} and follow the above code link, and made some changes as the input range is const inputRange = [
(index - 1.5) * ITEM_SIZE,
(index - 1) * ITEM_SIZE
] and const translateX = scrollX.interpolate({
inputRange,
outputRange:[0, width],
extrapolate:'clamp'
})
@@pixelwizardai where did you put useNativeDriver false
This guy is very underrated . He deserves more subscribers .
Prakash D thanks a lot for your kind words, you are awesome ✌️
Agree
Yes
True
Great work! I enjoyed every piece of it.
This was awesome, I loved it, super helpful.
Amazing tutorial. Thank you 😊
Thank you for making awesome tuts for us and inspiring the React Native movement!
Glad you like them and it's my pleasure Erik. I am involved in this community for more than 6 years and I simply love it. Thank you for sharing your thoughts ✌️
You deserve many more subscribers for this. Thank you for the quality content ☺️
Thank you Sridatta, I’m doing my best to teach as many things as possible and I’m just scratching the surface here:) ✌️
This is the best react native content I have ever seen.
Nice video, thanks for this content !
AWESOME tutorial.
Thank you!
Thanks for checking it out Arkham ✌️
Great tutorial, thanks
Awesome tutorial. Thank you!
Thank you Luan ✌️
Awesome video, clean code, no complications!
Thank you Aleks. I’m glad that you like it
Thank you very much. I'll share this video with my friends.
So nice of you Akmal, thank you! ✌️
very helpful tutorial! I learnt a lot about animations on rn through your videos 👍🏻 thank you...
Hey man, that was a really nice video, and a great learning. Thanks, from Brasil
Great tutorial again. Thank you so much
Uu, thanks a ton Anh ✌️
This interface is out of this world! 🥰🥰
Thanks, this is the best tutorial
Thanku so much bro I will be implementing this animation in my project, I will share your video in my friend circle I think you deserve more subscribers,🙂👍
Thank you Pradeep! ✌️
Best animation tutorials! Thanks! 👍
Wow, huge thanks Igor ✌️
Thank you very much for your great content. I'm going to watch all your videos. I'm new to react-native.
Glad you like them and welcome to React Native community Ibrahim! ✌️
Ohhhh... I can't express how happy I am like I can do all that stuff in css or framer motion but I was struggling to do that in react native and thought that I lost all my progress but your channel gave me hope to continue working on react native.
Also...
That is awesome! Thank you!
You’re welcome Nicolas, I’m glad that you like it✌️
Thank you from Brazil!
Just on time! Thanks!
You’re welcome. Thanks for checking out this video ✌️
Awesome job again, thanks man.
Thank you Bora, I’m glad you like it ✌️
Thanks keep making videos like this! :D
Thanks Snaaapzter! ✌️
Very cool. Thank you for this.
Glad you liked it and you're welcome. Thanks Mohd! ✌️
Awesome video, please continue making video like this.
Thank you, I will!
Bro.. it was amazing..!!! you are PRO
Man... You're the best!
This guy deserve to be the top react native teacher on youtube.
I'm pretty impressed with this tutorial and your way to teach is so good... Cam you please make a video on instgram stories animation that will be appreciated ❤️
Finally TH-cam suggested great channel
Very good video!
Great work Catalin
Thanks Nikhil!
Thanks!
earned yourself a subscriber here!
Your explanations are really nice, thanks for a great tutorial
Thank you Cheruiyot! I’m always trying to improve myself ✌️
@@CatalinMironDev That's great, you are so good, how long have you worked with react native?
@@collocheru Since January 2015 (I had access to the private React Native repository).
You can listen to my React Native Radio session to find out more about me and my work:
dev.to/reactnativeradio/rnr-122-react-native-animations-feat-catalin-miron
dev.to/reactnativeradio/rnr-168-animations-and-micro-interactions-in-react-native-with-catalin-miron
Thank you Cheruiyot ✌️
Awesome! Bring more animation videos, you explain very well. +1 sub
Thank you Youssef! There's more to come ✌️
Man this is awesome!
Thanks Darshan, I’m glad you liked it ✌️
this man is directly connected
Thank you so much man.
Happy to help! ✌️
Really really good!!!
Thank you so much for showing your support ✌️
you have my respect bro!
Awesome. Keep it up.
Thank you Kuldeep, I’m glad you like the video ✌️
Brillant 👍👏
Perfectly beautiful
or beautifully perfect
Thanks Saeed and I’m glad this helped you ✌️
Boooyaaah!! Lets go! Love you man.
😂 thanks Ade ✌️
Awesome vids thanks a lot
Thank you Oguzhan ✌️
Great!
I'm your new subscriber 😁
awesome 👍 thanks lord
I’m glad that you like it. Thanks Dio ✌️
I’m glad that you like it. Thanks Dio ✌️
You are god of Flat List Animation.
hahaha, thank you ✌️I just wanted to show that it is possible to create awesome stuff with React Native :)
awesome video!!! subscription
Thanks Juri ✌️
Master!
Grt Job Man 👍👍... You got a new subscriber 🤣
Thank you Rajib!
Great tutorial. I am wondering, how can I loop this content, in the Flatlist. Really finding hard on how to get the Flatlist items to loop.
Thanks a lot. Your videos have helped me understand React Native and Animations better every time. Thanks!!
Great work! By the way you can also add padding to the flatlist contentContainerStyle instead of doing a dummy element.
You are right! I wanted to show both ways dummy elements and padding (this will be in a future tutorial) but stick with padding. Thanks Danny ✌️
Nice tut on react native 🤘. I'm noob to react native . Dude u explain amazingly about all stuff....
I would suggest to try building from scratch..
Overall nice tuts dude🤘
Great suggestion! Thanks a lot Sahil it really means a lot to me to be able to help you! Thanks ✌️
Superb
Thank you! Cheers! ✌️
I hit like before I watch! !
Thank you so much Francis! ✌️
Thanks Catalin for this amazing content. By the way when you are starting making content on reanimated 2?
Maybe next year, I’m not yet finished with Animated API and most probably you’ll see Reanimated2 content after I’ll publish my Reanimated2 course. Cheers Hritik ✌️
Thanku so much
Any time Fatih ✌️
This is very good and I just want to know how you imagin before any animation
You're too cool bro
Wow, thanks a lot ✌️
Learn a lot
This is amazing, I'm glad to hear this! Thanks Aposte ✌️
Nice
Thanks
Man... You definitely should make an Udemy course on ReactNative animation...
Hi man, great work! Is it possible to add a swipe up and down to the centered item? Would be a great feature! Or if possible could you point me in the right direction on how to do this, thanks
Perfect
Thank you Furkan! ✌️
Awesome, could you make a vídeo of shuffling cards and when you choose one, it leaves from the card deck and go to another position
You've gotta get an animations course out man! Awesome stuff, thank you!
Thank you Josh! I'm working on it ❤️
@@CatalinMironDev Can't wait!
@@CatalinMironDev I'm waiting for it dude, awesome work brother
Catalin Miron I also suggested you on Twitter regarding the course.
@Catalin Miron hi can you please make a video on how use graphes in react native and how to show them on mobile it will be helpful for my project thank you for hearing me.
hey hi i really loved your teaching .. got a doubt how to pass props to components in shared element Screen ??
instead of using if statement to check and add view u can directly add view to before an after flatlist using listHeaderComponent and listFooterComponent
Great work!!
Can you help me with the Dynamic Input fields Adding to the array as an object. And showing it on click of plus button, with Animation?
I'm not getting it write or tell me where to look for it...
I like the curly brackets, what theme are you using in VS Code ? or what do you use to get these unique, more readable, brackets ?
Hi, my VSCode theme is Palenight and the font is called Operator Mono. Thanks Stefan ✌️
hello! awesome video
can you helpe, please?
I`m also animating opacity of the items to 0.5 when they are not in the center, but whenever I set a state on this screen, it messes with the opacity. I guess it re renders the list and reapply the opacity, so if im a the 3rd item up, they become invisible
would you know how to fix it?
thanks!
will you also make a video to make this a loop of bidirectional carousel?
Great Tutorial,
I used the fixed version on Android and I wasn't able to run at 60fps I got frames dropped .
this is due my phone?? or just because animated on android works like that?
You are goddamn awesome
Thank you so much Robert, I’m glad that you like my videos ✌️
I wonder if I can ever be in where you are in React Native
ty for the video i always watch the anim and try to make it by my own and then watch your solution , about the spacer it would be better if you have added paddingHorizontal to the flatlist container instead of creating a spacer element , ty for your videos again
it's so awesome
how can I add auto scrolling to this project?
Hello dear, thank you for all the work you have done. But for fix the flatlist active component in the middle of screen, you can use another smooth way. You can create a Empty component that will contain an empty view which must have SPACER_ITEM_SIZE as width value. Then put this component as listHeaderComponent and listFooterComponent for your flatlist. That is all. Sorry for my bad english guys.
Please, have you a store of paid react-native advanced animations courses for people who want it?
How do you stop the carousel so that it won't scroll more than one item per swipe?
If I am using a react native reanimated carousel, how can I get the scrollX to work
Hey! It is amazing video! Just have a question. How can I get current index of active item?
/>
We can make this infinity? Like a linked list? The last item is linked to the first and this idea. Well, i think this is better than the spacer in start and the end. The right spacer shows the first items and the left-spacer of the first item show the last. You can do this in another tutorial?
Thank u so much bro! But do u have video tutorial full about your project? I'm beginner. Pls
No, sorry :( I don't have a full working app for this carousel but this is also going to be part of 10 React Native challenges which I am doing now and it's the last video. Here's the Patreon post to see what we are going to build: www.patreon.com/posts/10-types-of-41446571
Good video and thanks for the knowledge you share with us. But I don't get the argument you pass in Animated.event in the onScroll prop. Where can I find documentation for the 'argMapping' in react-native (espacially for animated; confused af)
if anyone is interested, i found this:
{
"contentOffset": {
"x": 0,
"y": 2395.333333333333
},
"layoutMeasurement": {
"width": 414,
"height": 736
},
"contentSize": {
"width": 414,
"height": 5000
},
"zoomScale": 1,
"updatedChildFrames": [],
"contentInset": {
"right": 0,
"top": 0,
"left": 0,
"bottom": 0
}
}
animationbook.codedaily.io/scroll
if you could do some tutorials for firebase with react native from scratch would be awasome, there are not many of them and the available ones are not so good as well.
Thanks for your work!
I already have a series where I create a Habits app frok scratch with GraphQL (backend and mobile) but I will definitely consider expanding the content here. Thanks Felix ✌️
@@CatalinMironDev Thanks to you Catalin!
hi thanks for the video really usefull, i know nothing about reanimated v1 and v2 and i want to learn one of them should i start with v2 or v1 what do you suggest?
Thanks Kreb. To be honest, Reanimated2 is great and powerful, the only downside I'll say is that it is still in beta/alpha so is not that mature compared to Reanimated1. I'll create a course that will walk you through everything that you need to know about Reanimated2. I'll announce it here on the channel once it is ready!. Thanks!
can we have active index in this?
@Catalin Miron how to achieve dynamic scroll able vertical pager ( tabs ) with lazy effect.
Tutorial was very nice but your fonts got more attention. I also want to use that fonts and I searched everywhere but I can't find them. Can you please tell the font name?
please create one video for inshorts kind of animation in react native flatlist
Hey Catalin! Firstly, thanks for the tutorials, I've seen a lot of them already.
I have a doubt, I'm trying to animate the FlatList using the Reanimated v2, but I'm getting frame drops, which is making me start using the AnimatedAPI. Do you know how can I avoid frame drops on FlatLists using Reanimated v2? Anyone who sees this comment and is experiencing the same problem, know how to fix it?
Had the same problem yesterday. I solved it by building some limitor algorithms for the data being passed into the list. What's weird is that if you map the same data in a scrollview, you dont get the frame rate drop.
I selected same code of yours but background image is not moving . first one stays even i move to next movie