Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/tutosrive/lottie-kt-test/llms.txt

Use this file to discover all available pages before exploring further.

This demo app shows you how to bring Lottie animations to life on Android using Kotlin. It covers adding the Lottie dependency, loading animation files from the assets folder, controlling playback programmatically, and switching between animations at runtime — all wired together in a single MainActivity.

Introduction

Learn what this project demonstrates and how Lottie fits into Android development.

Quickstart

Clone the repo, open it in Android Studio, and run your first Lottie animation in minutes.

Implementation Guide

Step-by-step walkthroughs covering project setup, adding the dependency, and controlling animations.

API Reference

Explore the LottieAnimationView API, XML attributes, and build configuration used in this project.

How it works

The app renders a Lottie animation (wh.json) on launch and lets you tap a button to toggle between two animations (wh.json and logo2.json). Both JSON files live in app/src/main/assets/ and are loaded at runtime.
1

Add the Lottie dependency

Declare com.airbnb.android:lottie:6.7.1 in your build.gradle.kts dependencies block.
2

Place animation files in assets

Copy your Lottie JSON files into app/src/main/assets/. The library loads them by filename.
3

Add LottieAnimationView to your layout

Drop a <com.airbnb.lottie.LottieAnimationView> into your XML layout and set attributes like lottie_autoPlay and lottie_loop.
4

Control playback in Kotlin

Call setAnimation(), playAnimation(), and adjust speed or frame from your Activity or Fragment.

Build docs developers (and LLMs) love