commit | c02983a48daea0db4c04040a218be7de62f8c1d3 | [log] [tgz] |
---|---|---|
author | Gabriel Peal <gpeal@users.noreply.github.com> | Sun Dec 26 22:13:15 2021 -0800 |
committer | GitHub <noreply@github.com> | Sun Dec 26 22:13:15 2021 -0800 |
tree | ead89eea96b645bd40a276721afc36c658f0e05f | |
parent | 3d6f3b2285b4a2e2063a4d575e8a52f3efc38cf6 [diff] |
Reduce the memory footprint of software rendering (#1973) As of #1952, Lottie now handles its own bitmaps for software rendering. This was causing an issue for very large compositions. Lottie was creating a bitmap at the size of the entire composition which was often far larger than was needed. The most common case for this to happen is when people make 1928x1080 compositions in After Effects thinking it's 1:1 with displays. However, Lottie treats dimensions in dp which would cause a 1080p composition to have ~6000x4000 pixel bounds. With this PR, Lottie will now calculate the largest area that the bitmap can be rendered in given either its bounds, scale, or scaleType and then render a smaller bitmap to a larger area in the original canvas.
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.