commit | c32f18ede7873f4c5e16493456340ef9878830d9 | [log] [tgz] |
---|---|---|
author | Gabriel Peal <gpeal@users.noreply.github.com> | Sun Jul 15 22:08:03 2018 -0700 |
committer | GitHub <noreply@github.com> | Sun Jul 15 22:08:03 2018 -0700 |
tree | 59b12f715f5817763e6e1dfa06e0c3398b128ff1 | |
parent | 4ea04fd194649d48b217f91c260735f7d0852187 [diff] |
Refactored LottieCompositionFactory APIs (#830) Replaced existing `LottieComposition.Factory` methods with a new `LottieCompositionFactory` The main purpose of this is to provide a clean way to handle exceptions. Today, parsing exceptions are thrown on a background thread and impossible to handle. This replaces that with a new `LottieResult` which mimics a typical `Result` class in functional programming. It either has a result or an exception. The composition methods now return a `LottieTask<LottieResult<LottieComposition>>>`. You can add/remove listeners on the LottieTask. The listener will be called with the result that contains either the exception or error. This also deprecates all `LottieComposition.Factory` methods because they all have an analogous `LottieCompositionFactory` API. This PR also extracts LottieAnimationView's cache into a separate class and added tests which found an off by one error. #710
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:
Gradle is the only supported build configuration, so just add the dependency to your project build.gradle
file:
dependencies { implementation 'com.airbnb.android:lottie:2.5.5' }