Lottie Animation Guide for Android

Learn how to integrate Lottie animations into your Android app effortlessly.

1. Add Dependency

implementation 'com.airbnb.android:lottie:6.0.0'

2. Add Lottie Animation View

<com.airbnb.lottie.LottieAnimationView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:lottie_rawRes="@raw/animation"
    app:lottie_autoPlay="true"
    app:lottie_loop="true" />

3. Load Animation Programmatically

LottieAnimationView animationView = findViewById(R.id.animationView);
animationView.setAnimation(R.raw.animation);
animationView.playAnimation();

4. Control Animation

animationView.pauseAnimation(); // Pause
animationView.resumeAnimation(); // Resume
animationView.cancelAnimation(); // Stop

5. Get Lottie Animations

Find free animations at Unicornicons.