Lottie-android: Can't animate images from assets with setImageAssetsFolder

Created on 3 Jul 2017  路  3Comments  路  Source: airbnb/lottie-android

assets/demo/img_1.jpg, img_2.jpg upto img_20.jpg

Doesn't appear anything on simulator and S7

Try 1

<com.airbnb.lottie.LottieAnimationView
        android:id="@+id/animation_view"
        android:layout_width="300dp"
        android:layout_height="300dp"
        app:lottie_imageAssetsFolder="demo"
        android:background="#444"
        android:layout_centerHorizontal="true"
        app:lottie_loop="true"
        app:lottie_autoPlay="true" />

Try 2

animationView.setImageAssetsFolder("demo");
animationView.playAnimation();

Most helpful comment

@Qamar4P You're missing the animation itself (the json file). Add the json file exported by bodymovin to assets/ and set app:lottie_fileName="yourAnimation.json" in your layout.

All 3 comments

@Qamar4P can you attach a sample project that repros this?

@gpeal check out https://github.com/Qamar4P/CircularAnimationExamples, build and click on Gif button

@Qamar4P You're missing the animation itself (the json file). Add the json file exported by bodymovin to assets/ and set app:lottie_fileName="yourAnimation.json" in your layout.

Was this page helpful?
0 / 5 - 0 ratings