lottie-android - Render After Effects animations natively on Android and iOS, Web, and React Native Introduction · Lottie

How to add image folder in Xamarin Forms (PCL) to LottieXamarin

in a Xamarin Forms App (PCL), how to add the images folder in android and ios projects to lottie animation?

Thanks in advanced.

 var animation = new AnimationView
                Animation = "data.json",
                Loop = true,
                AutoPlay = true,
                VerticalOptions = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand


Source: (StackOverflow)

Lottie animation not working [closed]

How can I use Lottie Animation in Android? I tried but the animation doesn't run. How to start the JSON animation? I want to use a custom loading animation instead of using regular circular progress bar.

Source: (StackOverflow)

How to increase the lottie "LottieAnimationView" dimensions?

I am using Lottie for animations. The problem is lottie view dimensions are too small. is there a way to customize dimensions in lottie?

Source: (StackOverflow)

Can I start few frames and loop the rest of the frame without programmatically call setProgress()?

I want to make an animation e.g. showing something from very small in size to normal size and then repeat (loop) a set of frames.

Is that possible just by using AE + Bodymovin?

I know I can set the frame 0 to 100 and then loop between 101 to 300 frame but it would be nice if there was some kind of way to specify it inside the json file.

Source: (StackOverflow)

How to interpret and translate kotlin code to java?

I have been trying to translate this Kotlin code to Java since the project is in Java. I am translating by looking into Kotlin syntax. However, there are still others that I am having a hard time understanding.



private val animationView: LottieAnimationView by lazy {
    rootView.inflate(R.layout.app_intro_animation_view, false) as LottieAnimationView

private val viewPager: LockableViewPager by lazy {

override fun generateFinalButtonBehaviour(): IntroButton.Behaviour {
    return object : IntroButton.Behaviour {
        override fun setActivity(activity: IntroActivity) { finish() }
        override fun getActivity(): IntroActivity? = null
        override fun run() {}

private fun setViewPagerScroller() {
    try {
        val scrollerField = ViewPager::class.java.getDeclaredField("mScroller")
        scrollerField.isAccessible = true
        val interpolator = ViewPager::class.java.getDeclaredField("sInterpolator")
        interpolator.isAccessible = true

        val scroller = object : Scroller(this, interpolator.get(null) as Interpolator) {
            override fun startScroll(startX: Int, startY: Int, dx: Int, dy: Int, duration: Int) {
                super.startScroll(startX, startY, dx, dy, duration * 7)
        scrollerField.set(viewPager, scroller)
    } catch (e: NoSuchFieldException) {
        // Do nothing.
    } catch (e: IllegalAccessException) {
        // Do nothing.

For the setViewPagerScroller, I was able to translate the first part.

Field scrollerField = ViewPager.class.getDeclaredField("mScroller");

Field interpolator = ViewPager.class.getDeclaredField("sInterpolator");

Source: (StackOverflow)

Lottie Android: add color overlay to animation

I'm using Lottie for Android to add some animations in an app. In this app the primary and accent color can be chosen via the settings. I'm using an animation with a transparent background. To make the animation fit the chosen colors I'd like to add a color overlay to the animation, this way I can have one animation file but I can set the color programmatically.

Does anyone have an idea how I can manipulate the animation by adding a color overlay?

Source: (StackOverflow)

How do I implement Lottie for Xamarin.forms?

I went through the documentation of how to implement Lottie animation library.

I added the NuGet package Lottie for Xamarin.Forms and while debugging my android project for Xamarin Forms, it builds without an error but doesn't display an animation of the json file in my project.

Source: (StackOverflow)

Why is my Lottie animation THIS slow?

EDIT: To make it clear, it's slow to load, not to animate.

I'm using it on an AsyncTask as follows:

public class GetCurrentLocation extends AsyncTask<String, Void, String>{

private Context mContext;
private View view;

public GetCurrentLocation (View view, Context mContext) {
this.view = view;
this.mContext = mContext;

protected void onPreExecute() {
    //Custom Dialog
    customDialog = new Dialog(mContext);
    customDialog.setTitle("Looking for address");

    //Custom Dialog Animation
    LottieAnimationView animationView = (LottieAnimationView) customDialog.findViewById(R.id.animation_view);
    animationView.setAnimation("PinJump.json"); //Lottie's premade animation

    //Custom Dialog Text
    TextView text = (TextView) customDialog.findViewById(R.id.textView);

protected String doInBackground(String... params) {
//Code removed to shorten codeblock, it calls gps location here
return null;

protected void onPostExecute(String result) {
mPostSolicitationFragment.setLocalText(); //This is the method it transfer the GPS address to the view

Everything works well here.

My problem with this code is that once the dialog shows up, the Lottie animation takes a second before showing up on screen. If it's on 4G network I can see the animation. If it's on WIFI the only thing I can see is the text.

My question is, how can I make the animation shows up as soon as the dialog pops?

Source: (StackOverflow)

How to know when lottie animation is completed?

I have a fragment, here is the onCreateView method:

public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    mView = inflater.inflate(R.layout.fragment_added_to_cart_anim, container, false);
    ButterKnife.bind(this, mView);


    // Remove fragment when animation is finished.

    return mView;

I need to remove the fragment using getActivity().getSupportFragmentManager().beginTransaction().remove(this).commit(); when the lottie animation has ended. If I understand correctly, when the isAnimating() lottie method returns false the animation has ended and since in my configuration the animation does not loop this is when I should remove the current fragment. But I can't just use an if statement since when it is executed the animation may still be going.

I need a way to remove the fragment when the lottie animation ends, how do I do this?

Source: (StackOverflow)

Lottie for android - Error inflating class com.airbnb.lottie.LottieAnimationView

What I did:

Step 1)

Added the following dependency in graddle:

compile 'com.airbnb.android:lottie:2.0.0-beta4'

Step 2)

Airbnb do not tell us where to place the animated JSON files. Instead, I've seen it in their sample apps that it is placed on app/src/main/assets. So I created that folder and inserted some JSON animations there.

Step 3)

Added the following on activity_main.xml:

    app:layout_constraintTop_toTopOf="parent" />

Upon running the app I get the following error:

04-29 12:55:37.253 21877-21877/com.example.ross.testitout E/AndroidRuntime: FATAL EXCEPTION: main

Process: com.example.ross.testitout, PID: 21877

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.ross.testitout/com.example.ross.testitout.MainActivity}: android.view.InflateException: Binary XML file line #9: Binary XML file line #9: Error inflating class com.airbnb.lottie.LottieAnimationView 

at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)

Wondering what I'm doing wrong. There's also a lack of thorough tutorials, which is a shame, a beginner like me needs to spend way longer than necessary to figure things out.


Source: (StackOverflow)

Lottie Animation Library Z Ordering Issue

I'm currently playing around with the AirBnB's Lottie library for Android, and I'm having issues with LottieAnimationView Z ordering. Regardless of whether I place the LottieAnimationView at the top of the RelativeLayout, it always appears on top of all of the other elements in the layout ex:



   <! -- Other Elements that should appear on top of the background animation -->


I've also tried setting the LottieAnimationView's elevation to 0, but with no success at fixing the issue. Does anyone have an idea of how to fix this, or if it's just a limitation of the library? Also, if it's a limitation, what causes it?

Source: (StackOverflow)

Lottie Animation setAnimation() results IllegalStateException

I want to check Lottie lib for both IOS and Android today , I made a simple indicator animation in after effect and export it to .json file and its just work perfectly on IOS , when i test the same file on android version i got the following error, i really don't know if i'm missing any thing ?

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.lottietest/com.test.lottietest.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.airbnb.lottie.LottieAnimationView.setAnimation(java.lang.String)' on a null object reference

here is my activity XML

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

        android:layout_height="wrap_content" />

        android:text="animate" />


Activity code

public class MainActivity extends AppCompatActivity {
    LottieAnimationView anim;
    protected void onCreate(Bundle savedInstanceState) {
        anim = (LottieAnimationView) findViewById(R.id.animationView);

    public void animate(View view) {

Source: (StackOverflow)

lottie and user responsive animation

is there a way to make Lottie animation responsive to user action?

i.e.: we have two shapes, shape A is morphing its bounds, shape B is moving by some closed path. the user does drag, shape B must stop it's moving and start moving to shape B depending on user movement. on some distance from shape A, shape B must start morphing it's bound and try to magnetize to shape A changing its bounds.

Source: (StackOverflow)

Lottie Android - Using Lottie Android with vector image (xml) or svg image?

I'm using Lottie Android for animation and I put images (png) in assets folder of Android. And now I want to scale image base on devices density so I want to using vector image(xml file) or svg image instead but I haven't found any solution yet. Anyone has experience about that? Please give me some advice!

Source: (StackOverflow)

Picasso Callback on SDK 21 and Below

I have the following logic in my onBindViewHolder

final ImageView imageView = (ImageView) holder.view.findViewById(R.id.image);
    final Callback loadedCallback = new Callback() {
        public void onSuccess() {

        public void onError() {

    if (!TextUtils.isEmpty(getImageUri())) {
                .into(imageView, loadedCallback);

The reason I am using a custom callback is that Picasso doesn't support placing a Lottie animation in place while the call is happening. This is working for me on new SDK verisons however the call back is not triggered on SDK 21 and below. Is there a workaround I can use for these older versions of Android?

Thanks, Otterman

Source: (StackOverflow)