Use JsonReader for json parsing (#572)

Previously, Lottie used JsonObject for deserialization. That meant that:
1) Deserialization is not guaranteed to be O(n) where n is the size of the json file.
2) The entire json string must be loaded into memory.

Switching to JsonReader has the following advantages:
1) Reading is guaranteed to be O(n).
2) Large files can be read in buffers.

However, deserialization code is much more cumbersome because you can't query for things like the existence of a key, the length of an array, and you can't re-walk the same part of the json multiple times.

@felipecsl Did some work (#137, #139, #145, #152) a year ago to prepare to decouple parsing logic so that people could use jackson or some other method of deserialization. However, JsonReader is now the most optimal solution so some of the factory code can be simplified in a future PR.

## Performance
Most animations deserialize ~50% faster than before.
I was also able to deserialize a 50mb json file in 10s that couldn't come close to completing without OOMing before.

|Animation|Old time (ms)|New time (ms)|% improvement|
|----------|--------------|--------------|----------------|
|Tadah|107|55|48%|
|Nudge|100|51|49%|
|Notifications|85|48|43%|
|Star Wars|74|41|45%|
|City|65|24|64%|
|9squares|17|7|59%|
|Empty State|9|4|56%|
|Hello World|6|2|66%|
|Hamburger Arrow|2|1|50%|

Fixes #39 
  
  
49 files changed
tree: 840fb23c132a16533f0cd78ea5c47e6900cae8f8
  1. .github/
  2. .idea/
  3. After Effects Samples/
  4. gifs/
  5. gradle/
  6. lottie/
  7. LottieSample/
  8. .gitignore
  9. .travis.yml
  10. build.gradle
  11. CHANGELOG.md
  12. credentials.tar.gz
  13. DESIGNER_NOTES.md
  14. gradle.properties
  15. gradlew
  16. gradlew.bat
  17. LICENSE
  18. post_pr_comment.js
  19. README.md
  20. settings.gradle
  21. version.sh
README.md

Lottie for Android, iOS, React Native, and Web

Build Status

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:

View documentation, FAQ, help, examples, and more at airbnb.io/lottie

Example1

Example2

Example3

Community

Example4

Download

Gradle is the only supported build configuration, so just add the dependency to your project build.gradle file:

dependencies {
  compile 'com.airbnb.android:lottie:2.5.0-beta1'
}