commit | 33d7e1ca59f8c17d7b3cd17af14a6f68c181c2ab | [log] [tgz] |
---|---|---|
author | Allen Chen <allenchen1154@gmail.com> | Sat Aug 03 20:23:19 2024 -0700 |
committer | GitHub <noreply@github.com> | Sat Aug 03 23:23:19 2024 -0400 |
tree | 16fa862f235359d91fb78752f88956faa561ccb8 | |
parent | 3f39884cb0d0dddd86673b3826aad6fa508416ab [diff] |
Improve drop shadow effect accuracy (#2523) These changes make several improvements to how drop shadow effects are displayed: - Drop shadows now take parent alpha into account. This means that if a layer or fill has an animated opacity, the drop shadow will multiply that opacity with its own. - Adds drop shadow support to Image layers. There are some visual bugs with how the shadows are rendered, however. - Applies a constant scale factor to the distance and softness values from the Lottie file before passing them to `Paint.setShadowLayer()` to more closely match how they are displayed in After Effects. See https://github.com/airbnb/lottie-ios/pull/2175 for similar changes on iOS. - Adds three snapshot test files for distance, softness, and alpha validation. Distance test file: <img src="https://github.com/user-attachments/assets/aa559e60-0d8f-403b-acd0-fa571d6dcff5" width=400> Softness test file: <img src="https://github.com/user-attachments/assets/faa9819f-6584-49f5-91b7-7462213044f5" width=400> Example of Image layer shadow bug, right side is how it should look (capture from After Effects): <img width="1824" alt="image" src="https://github.com/user-attachments/assets/a3fb85c3-a5d1-4a6b-bbda-ff4e5ebd2fb5"> Co-authored-by: Gabriel Peal <gabriel@gpeal.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.