Updated 26 October 2021
What is Lottie?
Lottie is an animation library that parses After Effect animation exported JSON file i.e. produced by Bodymovin.
The main advantage of using Lottie is that animating CALayers (iOS) to generate complex animations is a tedious and very complicated job, instead, it’s more user-friendly to create the animation using After Effects.
Why Lottie?
What do we do with Lottie?
How will we implement animation with Lottie in our Project?
1 2 3 |
dependencies { compile 'com.airbnb.android:lottie:2.0.0-rc1' } |
How we use exported animated JSON file with LottieAnimationView?
1 2 3 4 5 6 |
<com.airbnb.lottie.LottieAnimationView android:id="@+id/animation_view1" android:layout_width="wrap_content" android:layout_height="wrap_content" app:lottie_fileName="Belo Foggy.json" app:lottie_loop="true"/> |
1 2 3 4 5 |
LottieAnimationView animationView3; animationView3 = (LottieAnimationView) findViewById(R.id.animation_view); animationView3.setAnimation("heart.json"); animationView3.loop(true); animationView3.playAnimation(); |
1 2 3 4 5 6 7 8 |
LottieComposition.Factory.fromAssetFileName(this, "data.json", new OnCompositionLoadedListener() { @Override public void onCompositionLoaded(LottieComposition composition) { normalAnimation.setComposition(composition); normalAnimation.loop(true); normalAnimation.playAnimation(); } }) ; |
LottieAnimationView :-
Reference : https://github.com/airbnb/lottie-android#image-support
If you have more details or questions, you can reply to the received confirmation email.
Back to Home
Be the first to comment.