100 likes | 111 Views
Follow the step-by-step procedure to add Lottie to an android app. Animatly provides Lottiefiles that can be used in your android app to provide a unique experience to your customers.<br><br>https://animatly.io/how-to-use
E N D
1. Introduction • A Lottie is a JSON-based animation file format that works on any website and app. It can scale up or down without pixelation. These files can be downloaded from Animatly.io. • Famous applications like Uber, Netflix, Google, Shopify, etc. are using Lottie in their apps. • It provides a theme to the app. Lottie Animation can be added in response to any event.
Step 1 : Select an Animation File • Just visit the official website of Animatly, which is a marketplace of animation compatible with Lottie. • Here you will find both free as well as paid animation as per your choice. • Choose your animation and download the .json file and save it to the res/raw folder on your app.
Step 2: Adding Lottie Dependency • Simply add the dependency to your app's build.gradle file and sync the changes. dependencies { // Replace lottieVersion with the latest version available implementation 'com.airbnb.android:lottie:$lottieVersion' }
Step 3: Adding LottieAnimationView to Your Layout XML file • You can add the LottieAnimationView just like any other layout element to your XML file. • You can modify parameters for the view like autoPlay, loop, speed, scale, progress, etc. to modify the looks and behavior of the animation. • Let the view know about the animation it has to display by adding app: lottie_rawRes='@raw/your_animation_file_name"
Step 4: Controlling animation from Java • For controlling the animation from Java or Kotlin code, you can access the LottieAnimationView in your Java/Kotlin code and call the available methods on it.
Lottie supports After Effects features. • The speed and color of a specific part of an animation can be changed dynamically by developers. • It makes engineering in animation simple and works on different platforms like iOS, Android, and React Native.