commit | 66bc2fb515dfc0036da7e83d5b136a01b803b7c9 | [log] [tgz] |
---|---|---|
author | Pranay Airan <pranay.airan@iiitb.net> | Fri Aug 30 11:58:42 2024 -0700 |
committer | GitHub <noreply@github.com> | Fri Aug 30 11:58:42 2024 -0700 |
tree | f30f1baad1114527c2f32ce9fd11656dc67c643c | |
parent | a1fb304f928be465ffcb344c3952cd47325ba48d [diff] |
[a11y] Adding reduce motion logic to LottieAnimation for compose usage (#2542) Our changes in https://github.com/airbnb/lottie-android/pull/2536 didn't work for `LottieAnimation` in compose. While LottieAnimation does use LottieDrawable, it has it's own animator and draws on canvas directly. This PR addresses that issue by making some logic of reduce motion readable outside LottieDrawable and consuming that logic in `LottieAnimation` I tested this by adding a sample lottie file with reduce motion marker locally, see the attached video. https://github.com/user-attachments/assets/eb33333f-86b8-46fa-9bbb-82bff8a8c7fe Co-authored-by: Pranay Airan <pranay.airan@airbnb.com>
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
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:
The latest stable Lottie-Compose version is: 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.