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.

The 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

lottie-kt-test/
└── app/
    ├── build.gradle.kts
    ├── proguard-rules.pro
    └── src/
        └── main/
            ├── AndroidManifest.xml
            ├── assets/
            │   ├── wh.json                     # First Lottie animation
            │   └── logo2.json                  # Second Lottie animation
            ├── java/
            │   └── com/srm/lottiee/
            │       └── MainActivity.kt
            └── res/
                ├── drawable/
                │   ├── ic_launcher_background.xml
                │   ├── ic_launcher_foreground.xml
                │   └── logo.webp               # Substituted via ImageAssetDelegate
                ├── layout/
                │   └── activity_main.xml
                ├── mipmap-anydpi-v26/
                │   ├── ic_launcher.xml
                │   └── ic_launcher_round.xml
                ├── mipmap-hdpi/
                │   ├── ic_launcher.webp
                │   └── ic_launcher_round.webp
                ├── mipmap-mdpi/
                │   ├── ic_launcher.webp
                │   └── ic_launcher_round.webp
                ├── mipmap-xhdpi/
                │   ├── ic_launcher.webp
                │   └── ic_launcher_round.webp
                ├── mipmap-xxhdpi/
                │   ├── ic_launcher.webp
                │   └── ic_launcher_round.webp
                ├── mipmap-xxxhdpi/
                │   ├── ic_launcher.webp
                │   └── ic_launcher_round.webp
                ├── values/
                │   ├── colors.xml
                │   ├── strings.xml
                │   └── themes.xml
                ├── values-night/
                │   └── themes.xml
                └── xml/
                    ├── backup_rules.xml
                    └── data_extraction_rules.xml

Key Files

MainActivity.kt
Kotlin source
The sole Activity in the application, located at app/src/main/java/com/srm/lottiee/MainActivity.kt. It is responsible for:
  • Inflating activity_main.xml and retrieving the LottieAnimationView (lottieView) and Button (btnChange) by their view IDs.
  • Loading the initial animation (wh.json) with setAnimation(), calling playAnimation(), then setting playback speed to 2.0f.
  • Registering an ImageAssetDelegate that returns R.drawable.logo (a logo.webp bitmap) for every image asset request made by the Lottie renderer.
  • Toggling between "wh.json" and "logo2.json" on each button click, resetting frame to 0, and calling playAnimation() to restart cleanly.
activity_main.xml
XML layout
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 (id btnChange, label “Change”) at the top.
  • A LottieAnimationView (id lottieView) that fills the remaining space, configured with lottie_autoPlay="true", lottie_loop="true", and lottie_repeatMode="restart".
wh.json / logo2.json
Lottie animation JSON
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.
logo.webp
Drawable resource
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.
build.gradle.kts
Gradle Kotlin DSL
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.
AndroidManifest.xml
XML manifest
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 under assets/.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <application
        android:allowBackup="true"
        android:dataExtractionRules="@xml/data_extraction_rules"
        android:fullBackupContent="@xml/backup_rules"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.Lottiee">
        <activity
            android:name=".MainActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>
Key manifest attributes:
AttributeValuePurpose
android:theme@style/Theme.LottieeApplies the project’s custom Material theme to the whole app
android:icon@mipmap/ic_launcherStandard launcher icon (PNG/WebP adaptive icon set)
android:roundIcon@mipmap/ic_launcher_roundCircular variant used on supported launchers
android:allowBackuptruePermits Android Auto Backup to include app data
android:exportedtrue on MainActivityRequired 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 in AndroidManifest.xml. Theme.Lottiee is defined in res/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 by enableEdgeToEdge() in MainActivity.
  • android:background="#1A1A1A" — set directly on the root ConstraintLayout in activity_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.
If you add a second Activity or Fragment in the future, you can apply the same dark background programmatically with window.decorView.setBackgroundColor(Color.parseColor("#1A1A1A")) rather than duplicating the hex value across multiple layout files.

Build docs developers (and LLMs) love