Author of the iOS side of things here. Feel Free to ask any questions!
Will this be available for swift?
Introducing Lottie: Airbnb's tool for adding animations to native apps
31–40 of 101 posts
Re: Introducing Lottie: Airbnb's tool for adding animations to native apps
#32Author of the Android side of things here. Feel Free to ask any questions!
Are the frames drawn to a bitmap first or straight to a canvas? Can a single animation object display different parts of itself in different stages of that animation, or would a duplicate animation object be required?
If there is a matte, an 8 bit bitmap will be created and if there is a mask, a 32 bit bitmap will be created and drawn to.
An animation can only be at one stage at a time but you can easily create multiple animations. If you want to have several copies of the same animation, there is a composition caching option that will prevent you from having to deserialize and parse the composition again.
Re: Introducing Lottie: Airbnb's tool for adding animations to native apps
#33Re: Introducing Lottie: Airbnb's tool for adding animations to native apps
#34Author of the Android side of things here. Feel Free to ask any questions!
Re: Introducing Lottie: Airbnb's tool for adding animations to native apps
#35Author of the iOS side of things here. Feel Free to ask any questions!
Off topic, but why is the iOS app so big? It's currently 130MB, which is almost 3x larger than the Android app and 10x larger than what I'd expect. Are you guys planning on slimming the app down? Is that 130MB mostly libraries you depend on, or is it mostly fonts, images and other assets? Thanks!
Some of this come from a mixture of architectures, and the fact we are using Swift+Objc, or just large asset files. Its something we are actively working on fixing. One of the things we did to make it better was build Lottie! Now we can replace PNG sequences and Gifs that can be several megabytes with simple JSON animation files which measure in the low kilobytes. One such example is the diamond animation found on our listing pages. To include this in the project before Lottie we had to package a PNG sequence for each screen resolution(@1x @2x @3x) with alpha these sequences would add around 4-5 megabytes to our app for a single, small, animation. With Lottie we package a single JSON file which measures around 2 kilobytes!
Re: Introducing Lottie: Airbnb's tool for adding animations to native apps
#36Any plan for a web React version? Or are CSS + JS in a good enough state where a new tool isn't necessary?
Re: Introducing Lottie: Airbnb's tool for adding animations to native apps
#37Earlier quoted context omitted.
Great question. Right now playing the animation with the imperative API in React Native will be driven entirely on the main thread, but the declarative API with `Animated` will not be (yet). I'm very interested in building the proper hooks natively to allow for usage with `useNativeDriver: true`. We are perfectly situated for this too, considering the author of the iOS side was also the engineer who introduced offloa…
What are you building with RN at airbnb? What has been your experience? If you were starting a mobile company now, would you start with RN ?
Various flows in the Airbnb app are built with React Native. Our recently launched "Experiences" platform is built mostly with React Native, and there are many flows in the app that are built with React Native. Overall it's probably about 10-20% of the app right now. The decision to use or not use React Native for a new feature is a function of what the team building the feature is familiar with, and whether or not we think we can deliver a good user experience with the technology or not. The answers to those questions are quickly evolving though as we build up more infrastructure around React Native, and as the familiarity with the platform grows.
> What has been your experience?
Generally positive, but the difficulty of integrating React Native into an existing mobile app with large existing native code bases should not be understated. It's not plug and play. I'm giving a talk about this in detail at React Conf in March. Make sure to check it out!
> If you were starting a mobile company now, would you start with RN ?
Yes.
Keep in mind that I was the main proponent of React Native being experimented with and adopted at Airbnb. As a result, I have some bias and other people at Airbnb might have different feelings / experiences.
Re: Introducing Lottie: Airbnb's tool for adding animations to native apps
#38Earlier quoted context omitted.
Great question. Right now playing the animation with the imperative API in React Native will be driven entirely on the main thread, but the declarative API with `Animated` will not be (yet). I'm very interested in building the proper hooks natively to allow for usage with `useNativeDriver: true`. We are perfectly situated for this too, considering the author of the iOS side was also the engineer who introduced offloa…
Is your navigation lib taking advantage of this? Just wondering, seeing as how React Navigation uses the Animated API
Re: Introducing Lottie: Airbnb's tool for adding animations to native apps
#39Re: Introducing Lottie: Airbnb's tool for adding animations to native apps
#40I wonder why they chose svg rendering over canvas for the react-native version.