commit | ba48b8233d8ad3c6b427fa55d9150d25a67272a3 | [log] [tgz] |
---|---|---|
author | Gabriel Peal <gabriel.peal@airbnb.com> | Tue Dec 06 17:56:31 2016 -0800 |
committer | Gabriel Peal <gabriel.peal@airbnb.com> | Tue Dec 06 19:04:30 2016 -0800 |
tree | 3651cfe6ec12e66244d532b97077aa54fe06ceb7 | |
parent | 99aaab50e1e45d65f3d376e9eb6f52ab09fe5bd7 [diff] |
Added icons for demo rows
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 6,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 animations are rendered by LottieAnimationView
. LottieAnimationView
animations are defined by a LottieComposition
. You can load a composition directly with LottieComposition.fromFile(...)
which will look in src/main/assets
or LottieComposition.fromJson(...)
if you have a raw JSONObject (useful for loading animations from the newtork).
However, the simplest way to use it is with an xml attribute or to let LottieAnimationView load the composition:
<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();
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
##Try it out Clone this repository and run the LottieSample module to see a bunch of sample animations. The JSON files for them are located in /assets.
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.
If you would like to add more JSON files and screenshot tests, feel free to do so and add the test to LottieTest
.