commit | 156a0ce18b75eacf87b361d00831c0ff60e44e2b | [log] [tgz] |
---|---|---|
author | Gabriel Peal <gabriel.peal@airbnb.com> | Tue Jan 03 16:43:02 2017 -0800 |
committer | Gabriel Peal <gabriel.peal@airbnb.com> | Tue Jan 03 16:43:02 2017 -0800 |
tree | c8adfc003994c7e5447ddc51bea9b1667ebabfc1 | |
parent | 15b817f077c6f6cd07fd335331adba1e62db5dd5 [diff] |
Cleaned up AppIntroFragment
Lottie is a mobile library for Andorid 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 enginineer painstakingly recreating it be hand.
They say a picture is worth 1,000 words so here are 7,000
Gradle is the only supported build configuration, so just add the dependency to your project build.gradle
file:
dependencies { compile 'com.airbnb.android:lottie-android:1.0.0' }
Lottie supports Jellybean (API 16) and above. The simplest way to use it is with LottieAnimationView:
<com.airbnb.lottie.LottieAnimationView android:id="@+id/animation_view" android:layout_width="wrap_content" android:layout_height="wrap_content" app:lottie_fileName="hello-world.json" app:lottie_loop="true"/>
Or you can load it programatically:
LottieAnimationView animationView = findViewById(R.id.animation_view); animationView.setAnimation("hello-world.json"); animationView.loop(true); animationView.playAnimation();
You can also load the composition directly using LottieComposition
and pass it to a LottieAnimationView
or LottieDrawable
.
In addition, LottieViewAnimator
allows you to define a view animation with After Effects. Check the docs for LottieViewAnimator
to learn more.
Clone this repository and run the LottieSample module to see a bunch of sample animations. The JSON files for them are located in /assets.
The sample app can also load json files at a given url or locally on your device (like Downloads or on your sdcard).
Lottie is named after a German film director and the foremost pioneer of silhouette animation. Her best known films are The Adventures of Prince Achmed (1926) – the oldest surviving feature-length animated film, preceding Walt Disney's feature-length Snow White and the Seven Dwarfs (1937) by over ten years The art of Lotte Reineger
Contributers are more than welcome. Just upload a PR with a description of your changes. Lottie uses Facebook screenshot tests for Android to identify pixel level changes/breakages. Please run ./gradlew --daemon recordMode screenshotTests
before uploading a PR to ensure that nothing has broken. Changed screenshots will show up in your git diff if you have.
If you would like to add more JSON files and screenshot tests, feel free to do so and add the test to LottieTest
.
File github issues for anything that is unexpectedly broken. If an After Effects file is not working, please attach it to your issue. Debugging without the original file is much more difficult.