[Compose] Allow custom cache keys, dynamic properties for images, and remove font remapping (#1847)

This set of changes is all around composition caching:

1) Increase the caching flexibility by allowing arbitrary cache keys.
2) Remove the cacheKey parameter from LottieCompositionSpec.JsonString because it was ambiguous with the new cacheKey parameter.
3) Add dynamic properties for bitmaps. This is helpful because it allows you to set a bitmap on a single LottieAnimation without overwriting the bitmap for the cacheable LottieComposition.
4) Removed fontRemapping for rememberLottieComposition because there was no way to know how to handle caching. Instead, dynamic properties can be used.
18 files changed
tree: d2a5d7baf51a8fc5b770e0cde0594ef3a99f3799
  1. .github/
  2. .idea/
  3. After Effects Samples/
  4. gifs/
  5. gradle/
  6. issue-repro/
  7. issue-repro-compose/
  8. lottie/
  9. lottie-compose/
  10. sample/
  11. sample-compose/
  12. .gitignore
  13. build.gradle
  14. CHANGELOG.md
  17. credentials.tar.gz
  18. decrypt.sh
  19. deploy_snapshot.sh
  21. gcloud_run.sh
  22. gcloud_setup.sh
  23. gradle.properties
  24. gradlew
  25. gradlew.bat
  27. post_pr_comment.js
  28. README.md
  29. RELEASE.md
  30. secrets.tar.enc
  31. settings.gradle
  32. sign.sh
  33. upload_release.sh
  34. version.sh

Lottie for Android, iOS, React Native, Web, and Windows

Build Status

Lottie is a mobile library for Android and iOS that parses Adobe After Effects animations exported as json with Bodymovin and renders them natively on mobile!

For the first time, designers can create and ship beautiful animations without an engineer painstakingly recreating it by hand. They say a picture is worth 1,000 words so here are 13,000:


Lottie is maintained and improved on nights and weekends. If you use Lottie in your app, please consider sponsoring it to help ensure that we can continue to improve the project we love. Click the sponsor button above to learn more

Lead Sponsors

View documentation, FAQ, help, examples, and more at airbnb.io/lottie







Gradle is the only supported build configuration, so just add the dependency to your project build.gradle file:

dependencies {
  implementation 'com.airbnb.android:lottie:$lottieVersion'

The latest Lottie version is: lottieVersion

The latest stable Lottie-Compose version is: lottieVersion Click here for more information on Lottie-Compose.

Lottie 2.8.0 and above only supports projects that have been migrated to androidx. For more information, read Google's migration guide.


Because development has started for Lottie Compose, Gradle, and the Android Gradle Plugin will be kept up to date with the latest canaries. This also requires you to use Android Studio Canary builds. Preview builds can be installed side by side with stable versions.