TheDocumentation 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.
lottie-kt-test project follows the standard Android Gradle single-module layout. All application source code, resources, and assets live under app/src/main/, and the Gradle build script sits at app/build.gradle.kts. The project is intentionally minimal — one Activity, two Lottie JSON animations, one substituted drawable, and a single layout file — making it straightforward to trace the full data flow from JSON asset to rendered animation.
Directory Layout
Key Files
The sole Activity in the application, located at
app/src/main/java/com/srm/lottiee/MainActivity.kt. It is responsible for:- Inflating
activity_main.xmland retrieving theLottieAnimationView(lottieView) andButton(btnChange) by their view IDs. - Loading the initial animation (
wh.json) withsetAnimation(), callingplayAnimation(), then setting playback speed to2.0f. - Registering an
ImageAssetDelegatethat returnsR.drawable.logo(alogo.webpbitmap) for every image asset request made by the Lottie renderer. - Toggling between
"wh.json"and"logo2.json"on each button click, resettingframeto0, and callingplayAnimation()to restart cleanly.
Located at
app/src/main/res/layout/activity_main.xml. Defines the entire UI as a ConstraintLayout (id main) with a dark #1A1A1A background, containing a vertical LinearLayout with:- A full-width
Button(idbtnChange, label “Change”) at the top. - A
LottieAnimationView(idlottieView) that fills the remaining space, configured withlottie_autoPlay="true",lottie_loop="true", andlottie_repeatMode="restart".
Both files live in
app/src/main/assets/ and are loaded by name string via lottieView.setAnimation(...). The assets/ directory is packaged with the APK and is accessible at runtime through the AssetManager. These are standard Lottie JSON files exported from After Effects or a compatible tool such as LottieFiles.Located at
app/src/main/res/drawable/logo.webp. This WebP image is decoded at runtime via BitmapFactory.decodeResource(resources, R.drawable.logo) inside the ImageAssetDelegate and returned to the Lottie renderer as a substitute for any image asset referenced in the JSON animations.Located at
app/build.gradle.kts. Configures the Android build with namespace com.srm.lottiee, minSdk 24, targetSdk 36, Java 11 compile options, release minification with R8, and all dependencies — including com.airbnb.android:lottie:6.7.1. See the Build Config reference page for full details.Located at
app/src/main/AndroidManifest.xml. Declares the application-level attributes (icon, label, backup rules, theme) and registers MainActivity as the only activity with an MAIN / LAUNCHER intent filter, making it the entry point when the app is launched.AndroidManifest
The full manifest is reproduced below. Note that no permissions are declared — the app requires no internet access or storage because all animation assets are bundled inside the APK underassets/.
| Attribute | Value | Purpose |
|---|---|---|
android:theme | @style/Theme.Lottiee | Applies the project’s custom Material theme to the whole app |
android:icon | @mipmap/ic_launcher | Standard launcher icon (PNG/WebP adaptive icon set) |
android:roundIcon | @mipmap/ic_launcher_round | Circular variant used on supported launchers |
android:allowBackup | true | Permits Android Auto Backup to include app data |
android:exported | true on MainActivity | Required for activities with an intent-filter (enforced from API 31) |
App Theme
The app’s visual style is applied at two levels:-
android:theme="@style/Theme.Lottiee"— declared on the<application>element inAndroidManifest.xml.Theme.Lottieeis defined inres/values/themes.xml(not shown here) and inherits from a Material Components theme, providing the button styles, colour palette, and edge-to-edge window behaviour enabled byenableEdgeToEdge()inMainActivity. -
android:background="#1A1A1A"— set directly on the rootConstraintLayoutinactivity_main.xml. This hard-coded dark charcoal background ensures the Lottie animations render against a consistent dark canvas regardless of the system light/dark mode setting.