Render After Effects animations natively on Android and iOS, Web, and React Native

Overview

Lottie for Android, iOS, React Native, Web, and Windows

Build Status

Get it on Google Play

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:

Sponsors

Lottie is maintained and improved on nights and weekends. If you use Lottie in your app, please consider sponsoring it to help ensure that we can continue to improve the project we love. Click the sponsor button above to learn more

Sponsor Button

Lead Sponsors

Duolingo

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 {
  implementation 'com.airbnb.android:lottie:$lottieVersion'
}

The latest Lottie version is: lottieVersion

The latest stable Lottie-Compose version is: lottieVersion Click here for more information on Lottie-Compose.

Lottie 2.8.0 and above only supports projects that have been migrated to androidx. For more information, read Google's migration guide.

Contributing

Because development has started for Lottie Compose, Gradle, and the Android Gradle Plugin will be kept up to date with the latest canaries. This also requires you to use Android Studio Canary builds. Preview builds can be installed side by side with stable versions.

Comments
  • JSON Reader AssertionError when doInBackground (Android 7, 8)

    JSON Reader AssertionError when doInBackground (Android 7, 8)

    Hi guys, in latest Lottie Android version (2.5.0) we are having several crashes at doInBackground() method. This crash is only happening on Android 7 and 8 versions.

    Here is our animation preloading code:

    class LottieAnimations {
    
        companion object {
    
            @JvmStatic
            var willyWaiting: LottieAnimation? = null
            var specialBonusCollectCoins: LottieAnimation? = null
            var specialBonusCollectGems: LottieAnimation? = null
    
            @JvmStatic
            fun load(context: Context) {
                fromAssetFileName(context, "animation/waiting_lottie/data.json") {
                    it?.let { willyWaiting = LottieAnimation(it, "animation/waiting_lottie/images") }
                }
    
                fromAssetFileName(context, "animation/special_bonus_collect_coins/data.json") {
                    it?.let { specialBonusCollectCoins = LottieAnimation(it, "animation/special_bonus_collect_coins/images") }
                }
    
                fromAssetFileName(context, "animation/special_bonus_collect_gems/data.json") {
                    it?.let { specialBonusCollectGems = LottieAnimation(it, "animation/special_bonus_collect_gems/images") }
                }
            }
        }
    
    }
    

    Here is the StackTrace:

    OS Version: 8.0.0 Device: Xperia X RAM Free: 38.5% Disk Free: 60.8%

    #0. Crashed: AsyncTask #4 at android.os.AsyncTask$3.done(AsyncTask.java:353) at java.#util.concurrent.FutureTask.finishCompletion(FutureTask.java:383) at java.util.concurrent.FutureTask.setException(FutureTask.java:252) at java.util.concurrent.FutureTask.run(FutureTask.java:271) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:764)

    --

    Fatal Exception: java.lang.RuntimeException: An error occurred while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:353) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383) at java.util.concurrent.FutureTask.setException(FutureTask.java:252) at java.util.concurrent.FutureTask.run(FutureTask.java:271) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:764)

    Caused by java.lang.AssertionError at android.util.JsonReader.peek(JsonReader.java:363) at android.util.JsonReader.expect(JsonReader.java:308) at android.util.JsonReader.beginObject(JsonReader.java:293) at com.airbnb.lottie.parser.LottieCompositionParser.parse(SourceFile:42) at com.airbnb.lottie.LottieComposition$Factory.fromJsonSync(SourceFile:269) at com.airbnb.lottie.parser.AsyncCompositionLoader.doInBackground(SourceFile:22) at com.airbnb.lottie.parser.AsyncCompositionLoader.doInBackground(SourceFile:12) at android.os.AsyncTask$2.call(AsyncTask.java:333) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:764)

    #0. Crashed: AsyncTask #4 at android.os.AsyncTask$3.done(AsyncTask.java:353) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383) at java.util.concurrent.FutureTask.setException(FutureTask.java:252) at java.util.concurrent.FutureTask.run(FutureTask.java:271) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:764)

    #1. pool-2-thread-1 at java.lang.Object.wait(Object.java) at java.lang.Thread.parkFor$(Thread.java:2135) at sun.misc.Unsafe.park(Unsafe.java:358) at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:230) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2101) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1132) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1087) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1147) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:764)

    #2. httpThread at android.os.MessageQueue.nativePollOnce(MessageQueue.java) at android.os.MessageQueue.next(MessageQueue.java:375) at android.os.Looper.loop(Looper.java:225) at android.os.HandlerThread.run(HandlerThread.java:65)

    #3. ConnectivityThread at android.os.MessageQueue.nativePollOnce(MessageQueue.java) at android.os.MessageQueue.next(MessageQueue.java:375) at android.os.Looper.loop(Looper.java:225) at android.os.HandlerThread.run(HandlerThread.java:65)

    #4. pool-3-thread-1 at java.lang.Object.wait(Object.java) at java.lang.Thread.parkFor$(Thread.java:2135) at sun.misc.Unsafe.park(Unsafe.java:358) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:190) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2059) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1120) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1087) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1147) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:764)

    Any ideas?

    Tnx in advance

    opened by fertwo 52
  • Error: java.lang.StackOverflowError: stack size 8MB

    Error: java.lang.StackOverflowError: stack size 8MB

    I'm not really sure why it happens but maybe i'm not releasing my fragment ( there is 3 fragment on top and each of it has 1 Lottie animation view )

    Device: P6 android 5.0

    Fatal Exception: java.lang.StackOverflowError: stack size 8MB
           at com.airbnb.lottie.LottieAnimationView.buildDrawingCache + 838(LottieAnimationView.java:838)
           at android.view.View.getDrawingCache + 14328(View.java:14328)
           at com.airbnb.lottie.LottieAnimationView.buildDrawingCache + 839(LottieAnimationView.java:839)
           at android.view.View.getDrawingCache + 14328(View.java:14328)
           at com.airbnb.lottie.LottieAnimationView.buildDrawingCache + 839(LottieAnimationView.java:839)
           at android.view.View.getDrawingCache + 14328(View.java:14328)
           at com.airbnb.lottie.LottieAnimationView.buildDrawingCache + 839(LottieAnimationView.java:839)
           at android.view.View.getDrawingCache + 14328(View.java:14328)
           at com.airbnb.lottie.LottieAnimationView.buildDrawingCache + 839(LottieAnimationView.java:839)
           at android.view.View.getDrawingCache + 14328(View.java:14328)
           at com.airbnb.lottie.LottieAnimationView.buildDrawingCache + 839(LottieAnimationView.java:839)
           at android.view.View.getDrawingCache + 14328(View.java:14328)
           at com.airbnb.lottie.LottieAnimationView.buildDrawingCache + 839(LottieAnimationView.java:839)
           at android.view.View.getDrawingCache + 14328(View.java:14328)
           at com.airbnb.lottie.LottieAnimationView.buildDrawingCache + 839(LottieAnimationView.java:839)
           at android.view.View.getDrawingCache + 14328(View.java:14328)
           at com.airbnb.lottie.LottieAnimationView.buildDrawingCache + 839(LottieAnimationView.java:839)
           at android.view.View.getDrawingCache + 14328(View.java:14328)
           at com.airbnb.lottie.LottieAnimationView.buildDrawingCache + 839(LottieAnimationView.java:839)
           at android.view.View.getDrawingCache + 14328(View.java:14328)
           at com.airbnb.lottie.LottieAnimationView.buildDrawingCache + 839(LottieAnimationView.java:839)
           at android.view.View.updateDisplayListIfDirty + 14215(View.java:14215)
           at android.view.View.getDisplayList + 14271(View.java:14271)
           at android.view.View.draw + 15056(View.java:15056)
           at android.view.ViewGroup.drawChild + 3528(ViewGroup.java:3528)
           at android.view.ViewGroup.dispatchDraw + 3322(ViewGroup.java:3322)
           at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw + 1873(ConstraintLayout.java:1873)
           at android.view.View.draw + 15363(View.java:15363)
           at android.view.View.updateDisplayListIfDirty + 14241(View.java:14241)
           at android.view.View.getDisplayList + 14271(View.java:14271)
           at android.view.View.draw + 15056(View.java:15056)
           at android.view.ViewGroup.drawChild + 3528(ViewGroup.java:3528)
           at android.view.ViewGroup.dispatchDraw + 3322(ViewGroup.java:3322)
           at android.view.View.updateDisplayListIfDirty + 14233(View.java:14233)
           at android.view.View.getDisplayList + 14271(View.java:14271)
           at android.view.View.draw + 15056(View.java:15056)
           at android.view.ViewGroup.drawChild + 3528(ViewGroup.java:3528)
           at android.view.ViewGroup.dispatchDraw + 3322(ViewGroup.java:3322)
           at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw + 1873(ConstraintLayout.java:1873)
           at android.view.View.draw + 15363(View.java:15363)
           at android.view.View.updateDisplayListIfDirty + 14241(View.java:14241)
           at android.view.View.getDisplayList + 14271(View.java:14271)
           at android.view.View.draw + 15056(View.java:15056)
           at android.view.ViewGroup.drawChild + 3528(ViewGroup.java:3528)
           at android.view.ViewGroup.dispatchDraw + 3322(ViewGroup.java:3322)
           at android.view.View.updateDisplayListIfDirty + 14233(View.java:14233)
           at android.view.View.getDisplayList + 14271(View.java:14271)
           at android.view.View.draw + 15056(View.java:15056)
           at android.view.ViewGroup.drawChild + 3528(ViewGroup.java:3528)
           at android.view.ViewGroup.dispatchDraw + 3322(ViewGroup.java:3322)
           at android.view.View.updateDisplayListIfDirty + 14233(View.java:14233)
           at android.view.View.getDisplayList + 14271(View.java:14271)
           at android.view.View.draw + 15056(View.java:15056)
           at android.view.ViewGroup.drawChild + 3528(ViewGroup.java:3528)
           at android.view.ViewGroup.dispatchDraw + 3322(ViewGroup.java:3322)
           at android.view.View.updateDisplayListIfDirty + 14233(View.java:14233)
           at android.view.View.getDisplayList + 14271(View.java:14271)
           at android.view.View.draw + 15056(View.java:15056)
           at android.view.ViewGroup.drawChild + 3528(ViewGroup.java:3528)
           at android.view.ViewGroup.dispatchDraw + 3322(ViewGroup.java:3322)
           at android.view.View.updateDisplayListIfDirty + 14233(View.java:14233)
           at android.view.View.getDisplayList + 14271(View.java:14271)
           at android.view.View.draw + 15056(View.java:15056)
           at android.view.ViewGroup.drawChild + 3528(ViewGroup.java:3528)
           at android.view.ViewGroup.dispatchDraw + 3322(ViewGroup.java:3322)
           at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchDraw + 2670(PhoneWindow.java:2670)
           at android.view.View.draw + 15363(View.java:15363)
           at android.widget.FrameLayout.draw + 647(FrameLayout.java:647)
           at com.android.internal.policy.impl.PhoneWindow$DecorView.draw + 2649(PhoneWindow.java:2649)
           at android.view.View.updateDisplayListIfDirty + 14241(View.java:14241)
           at android.view.View.getDisplayList + 14271(View.java:14271)
           at android.view.ThreadedRenderer.updateViewTreeDisplayList + 267(ThreadedRenderer.java:267)
           at android.view.ThreadedRenderer.updateRootDisplayList + 273(ThreadedRenderer.java:273)
           at android.view.ThreadedRenderer.draw + 312(ThreadedRenderer.java:312)
           at android.view.ViewRootImpl.draw + 2852(ViewRootImpl.java:2852)
           at android.view.ViewRootImpl.performDraw + 2689(ViewRootImpl.java:2689)
           at android.view.ViewRootImpl.performTraversals + 2313(ViewRootImpl.java:2313)
           at android.view.ViewRootImpl.doTraversal + 1251(ViewRootImpl.java:1251)
           at android.view.ViewRootImpl$TraversalRunnable.run + 6438(ViewRootImpl.java:6438)
           at android.view.Choreographer$CallbackRecord.run + 795(Choreographer.java:795)
           at android.view.Choreographer.doCallbacks + 598(Choreographer.java:598)
           at android.view.Choreographer.doFrame + 567(Choreographer.java:567)
           at android.view.Choreographer$FrameDisplayEventReceiver.run + 781(Choreographer.java:781)
           at android.os.Handler.handleCallback + 810(Handler.java:810)
           at android.os.Handler.dispatchMessage + 99(Handler.java:99)
           at android.os.Looper.loop + 189(Looper.java:189)
           at android.app.ActivityThread.main + 5529(ActivityThread.java:5529)
           at java.lang.reflect.Method.invoke(Method.java)
           at java.lang.reflect.Method.invoke + 372(Method.java:372)
           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run + 950(ZygoteInit.java:950)
           at com.android.internal.os.ZygoteInit.main + 745(ZygoteInit.java:745)
    
    opened by namkazt 48
  • Crash: java.lang.IllegalStateException Unable to create layer for LottieAnimationView, size 1088x-448 max size 8192 color type 4 has context 1

    Crash: java.lang.IllegalStateException Unable to create layer for LottieAnimationView, size 1088x-448 max size 8192 color type 4 has context 1

    I just upgrade lottie version from 2.7.0 to 3.0.7. I got some new crash in the latest version app.

    StackTrace in Android 9:

    main(2)

    java.lang.IllegalStateException

    Unable to create layer for LottieAnimationView, size 1088x-448 max size 16384 color type 4 has context 1

    1 android.os.MessageQueue.nativePollOnce(Native Method)

    2 android.os.MessageQueue.next(MessageQueue.java:330) 3 android.os.Looper.loop(Looper.java:169) 4 android.app.ActivityThread.main(ActivityThread.java:7083) 5 java.lang.reflect.Method.invoke(Native Method) 6 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 7 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:876)

    Anyone is try to fix this problem?

    Non-Rendering Bug 
    opened by lchad 38
  • Bug: Weird crash when showing a Lottie animation :

    Bug: Weird crash when showing a Lottie animation : "Invalid Layer Save Flag"

    Tested on Pixel 2 with Android P DP3. I tried to disable hardware acceleration. Didn't help. Version 2.5.5 of the library, but also on 2.5.4 (updated because I was hoping it will fix it). Doesn't seem to occur on older Android versions. Also, file can be shown just fine via the sample Lottie app from the Play Store. I see some logs of this sort, before the crash.

    E/AbstractTracker: Can't create handler inside thread that has not called Looper.prepare()

    But I can't find out where this occurs, and can't see which class cause it.

    I've also noticed that another animation of Lottie also causes this crash, but another doesn't.

    This is how we use it:

    <...LottieAnimationViewEx
        android:layout_width="@dimen/please_wait_big__animation_size" android:layout_height="@dimen/please_wait_big__animation_size" app:lottie_autoPlay="true"
        app:lottie_loop="true" app:lottie_rawRes="@raw/please_wait_big"
        tools:src="@android:drawable/sym_def_app_icon"/>
    

    And this is the code of the LottieAnimationViewEx class:

    class LottieAnimationViewEx @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : LottieAnimationView(context, attrs, defStyleAttr) {
    
        init{
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
                useHardwareAcceleration(true)
        }
    
    }
    

    This is what I get in logs :

    2018-06-11 10:17:25.666 27443-27443/... E/AndroidRuntime: FATAL EXCEPTION: main Process: ..., PID: 27443 java.lang.IllegalArgumentException: Invalid Layer Save Flag - only ALL_SAVE_FLAGS is allowed at android.graphics.Canvas.checkValidSaveFlags(Canvas.java:378) at android.graphics.Canvas.saveLayer(Canvas.java:455) at com.airbnb.lottie.model.layer.BaseLayer.draw(BaseLayer.java:224) at com.airbnb.lottie.model.layer.CompositionLayer.drawLayer(CompositionLayer.java:100) at com.airbnb.lottie.model.layer.BaseLayer.draw(BaseLayer.java:190) at com.airbnb.lottie.LottieDrawable.draw(LottieDrawable.java:312) at android.widget.ImageView.onDraw(ImageView.java:1360) at android.view.View.draw(View.java:20205) at android.view.View.updateDisplayListIfDirty(View.java:19080) at android.view.View.draw(View.java:19933) at android.view.ViewGroup.drawChild(ViewGroup.java:4333) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112) at android.view.View.draw(View.java:20208) at android.view.View.updateDisplayListIfDirty(View.java:19080) at android.view.View.draw(View.java:19933) at android.view.ViewGroup.drawChild(ViewGroup.java:4333) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112) at android.view.View.updateDisplayListIfDirty(View.java:19071) at android.view.View.draw(View.java:19933) at android.view.ViewGroup.drawChild(ViewGroup.java:4333) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112) at android.view.View.updateDisplayListIfDirty(View.java:19071) at android.view.View.draw(View.java:19933) at android.view.ViewGroup.drawChild(ViewGroup.java:4333) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112) at android.view.View.draw(View.java:20208) at com.android.internal.policy.DecorView.draw(DecorView.java:780) at android.view.View.updateDisplayListIfDirty(View.java:19080) at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:685) at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:691) at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:799) at android.view.ViewRootImpl.draw(ViewRootImpl.java:3263) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3079) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2459) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1447) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7130) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:935) at android.view.Choreographer.doCallbacks(Choreographer.java:747) at android.view.Choreographer.doFrame(Choreographer.java:682) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:921) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6642) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

    I wanted to create a new POC with this issue, and publish here, but then I got this weird error, just by adding the dependency of Lottie :

    image

    FAILURE: Build failed with an exception.

    • What went wrong: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.

    com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\0.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\1.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\2.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\3.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\4.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\5.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\6.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\7.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\8.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\9.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\10.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\11.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\12.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\13.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\14.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\15.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\16.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\18.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\19.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\21.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\23.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\24.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\25.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\26.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\27.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\28.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\29.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\30.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\31.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\32.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\33.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\34.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\35.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\36.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\37.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\38.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\39.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\40.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\41.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\42.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\43.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\44.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\45.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\46.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\48.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\49.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\50.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\51.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\52.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\53.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\54.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\55.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\56.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\57.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\58.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\59.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\61.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\62.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\63.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\64.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\65.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\66.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\67.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\68.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\69.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\70.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\71.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\72.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\73.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\74.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\75.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\76.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\77.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\78.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\79.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\80.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\81.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\82.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\83.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\84.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\85.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\86.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\87.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\88.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\89.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\90.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\91.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\92.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\93.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\94.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\95.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\96.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\97.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\98.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\99.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\100.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\101.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\102.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\103.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\104.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\105.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\106.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\107.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\108.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\109.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\110.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\111.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\113.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\114.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\115.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\117.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\118.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\119.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\120.jar, C:\Users\User\AndroidStudioProjects\MyApplication7\app\build\intermediates\transforms\dexBuilder\debug\121.jar

    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    • Get more help at https://help.gradle.org

    What's going on?

    opened by AndroidDeveloperLB 35
  • Missing values for keyframe

    Missing values for keyframe

    I'm exporting my animation using BodyMovin and I'm getting this error

     java.lang.IllegalStateException: Missing values for keyframe.
            at com.airbnb.lottie.animation.keyframe.FloatKeyframeAnimation.getValue(FloatKeyframeAnimation.java:16)
            at com.airbnb.lottie.animation.keyframe.FloatKeyframeAnimation.getValue(FloatKeyframeAnimation.java:8)
            at com.airbnb.lottie.animation.keyframe.BaseKeyframeAnimation.getValue(BaseKeyframeAnimation.java:125)
            at com.airbnb.lottie.animation.keyframe.TransformKeyframeAnimation.getMatrix(TransformKeyframeAnimation.java:113)
    

    I also have problems when I try to click on "edit layer colors" it doesn't show the animation, what I'm missing?

    opened by joancolmenerodev 29
  • Support centered text

    Support centered text

    I am testing with a simple text layer but the alignment of the text is different in lottie app from the preview in after effects. I haven't done any changes to a new project expect for a text layer I am attaching screenshots and json file

    Ae preview capture

    in lottie app

    screenshot_2017-07-17-23-53-34-559_com airbnb lottie

    As you can see the text is aligned differently on app json data.zip

    Text 
    opened by farazahmed7 26
  • Fatal signal 11 crash on Android 7.0

    Fatal signal 11 crash on Android 7.0

    This has been happening for a little while for us apparently, but we don't get crash logs reported from it since the crash seems to be occurring in native code. It happens on the latest version of Lottie (3.3.0) and previous ones.

    We have an an animation that causes our app to crash whenever we play it forward or backward. It only crashes on devices running 7.0 (pre-7.0 and post-7.0, including 7.x.x are fine). Here's what I'm seeing in the Logcat:

    A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x4 in tid 7235 (RenderThread)
    *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    pid: 3801, tid: 4185, name: RenderThread  >>> com.transloc.microtransit.dev.debug <<<
    signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4
        r0 8ed30730  r1 00000000  r2 00000044  r3 af30a4b1
        r4 8e82b478  r5 8e82b478  r6 00000000  r7 849e4680
        r8 8e82b278  r9 00000001  sl 8597bf00  fp 8e82b1c0
        ip af369628  sp 8e82b110  lr af31a759  pc af34e29a  cpsr a00f0030
    backtrace:
        #00 pc 0006329a  /system/lib/libhwui.so
        #01 pc 0006299b  /system/lib/libhwui.so
        #02 pc 000625d5  /system/lib/libhwui.so
        #03 pc 00023e5f  /system/lib/libhwui.so
        #04 pc 000258b3  /system/lib/libhwui.so
        #05 pc 00028d51  /system/lib/libhwui.so (_ZN7android10uirenderer12renderthread12RenderThread10threadLoopEv+80)
        #06 pc 0000e3e5  /system/lib/libutils.so (_ZN7android6Thread11_threadLoopEPv+140)
        #07 pc 00068a15  /system/lib/libandroid_runtime.so (_ZN7android14AndroidRuntime15javaThreadShellEPv+80)
        #08 pc 000474e3  /system/lib/libc.so (_ZL15__pthread_startPv+22)
        #09 pc 00019dcd  /system/lib/libc.so (__start_thread+6)
    

    I've reproduced the issue by starting a new empty project that only has a LottieAnimationView.

    Here's the layout:

    <?xml version="1.0" encoding="utf-8"?>
    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".MainActivity">
    
        <com.airbnb.lottie.LottieAnimationView
            android:id="@+id/pin_button"
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:layout_gravity="center"
            app:lottie_fileName="pinning_animation.json" />
    
    </FrameLayout>
    

    And here's the Activity:

    package com.transloc.lottietest
    
    import androidx.appcompat.app.AppCompatActivity
    import android.os.Bundle
    import com.airbnb.lottie.LottieAnimationView
    import com.airbnb.lottie.RenderMode
    
    class MainActivity : AppCompatActivity() {
    
        override fun onCreate(savedInstanceState: Bundle?) {
            super.onCreate(savedInstanceState)
            setContentView(R.layout.activity_main)
    
            val pinButton = findViewById<LottieAnimationView>(R.id.pin_button)
    
            pinButton.setOnClickListener {
                pinButton.resumeAnimation()
            }
        }
    }
    

    The animation will play briefly, then the app will freeze momentarily, and then it will crash. I've found that setting the render mode to SOFTWARE will work around the issue.

    Help wanted 
    opened by curtismartintransloc 25
  • Optimized test coroutines

    Optimized test coroutines

    Downloading, parsing, and snapshotting now all happen on individual coroutines on with the correct dispatchers which allows things to happen in parallel.

    opened by gpeal 24
  • NPE on CompositionLayer

    NPE on CompositionLayer

    Hi! This has been happening recently, last release included:

    Fatal Exception: java.lang.NullPointerException at com.airbnb.lottie.model.layer.CompositionLayer.(SourceFile:8120) at com.airbnb.lottie.LottieDrawable.b(SourceFile:201) at com.airbnb.lottie.LottieAnimationView.setComposition(SourceFile:11164)

    opened by stefanomemrise 24
  • Reduce the memory footprint of software rendering

    Reduce the memory footprint of software rendering

    As of https://github.com/airbnb/lottie-android/pull/1952, Lottie now handles its own bitmaps for software rendering. This was causing an issue for very large compositions. Lottie was creating a bitmap at the size of the entire composition which was often far larger than was needed.

    The most common case for this to happen is when people make 1928x1080 compositions in After Effects thinking it's 1:1 with displays. However, Lottie treats dimensions in dp which would cause a 1080p composition to have ~6000x4000 pixel bounds.

    With this PR, Lottie will now calculate the largest area that the bitmap can be rendered in given either its bounds, scale, or scaleType and then render a smaller bitmap to a larger area in the original canvas.

    opened by gpeal 23
  • Move snapshot tests into their own app and improve performance

    Move snapshot tests into their own app and improve performance

    The dedicated module prevents extra code in the main sample app modules and allows for easy creation of compose snapshot tests. I also found a bug in which the rendering of animations was not fan-in when it should have been. This increased the performance of the test suite locally by ~7x.

    opened by gpeal 23
  • Animation with Adobe After Effects files that consist of png images does not support system scale changes

    Animation with Adobe After Effects files that consist of png images does not support system scale changes

    Lottie is supported and developed on nights and weekends. Issues from Lottie sponsors will be prioritized.

    If you don't use this template, your issue will be closed. Delete this text once completed.

    Checklist

    1. My animation doesn't use any unsupported features.
    2. I know what part of my animation doesn't work.
    3. I have created a simplified version of my animation
    4. I have attached the AEP file (as a zip file so it can be attached) that only has the part of the animation that doesn't work.

    Describe the bug

    Any animations with Adobe After Effects files that consist of png images do not support system scaling

    What version of Lottie did you test this on?

    lottie-compose:5.2.0

    What version of Android did you test this on?

    Android 10/13, but I think it doesn't depend on the Android version

    Steps To Reproduce

    Steps to reproduce the behavior:

    1. Run any animation with Adobe After Effects files that consist of png images (ex: https://lottiefiles.com/131823-investment) screenshot 1
    2. Go to system settings and change the scale settings of user interface screenshot 2
    3. Go back to app screenshot 3
    4. See error

    Code

    class MainActivity : ComponentActivity() {
        override fun onCreate(savedInstanceState: Bundle?) {
            super.onCreate(savedInstanceState)
            val animation = "https://assets9.lottiefiles.com/packages/lf20_dnGoCmSHJx.json"
            setContent {
                LottieTestTheme {
                    Surface(
                        modifier = Modifier.fillMaxSize(),
                        color = MaterialTheme.colors.background
                    ) {
                        val composition by rememberLottieComposition(
                            spec = LottieCompositionSpec.Url(animation)
                        )
                        LottieAnimation(
                            composition = composition,
                            iterations = LottieConstants.IterateForever,
                            contentScale = ContentScale.FillWidth,
                            alignment = Alignment.TopCenter,
                            modifier = Modifier.fillMaxSize()
                        )
                    }
                }
            }
        }
    }
    
    Rendering bug 
    opened by AndreyBro48 0
  • lottie-android and lottie-web has different behavior.

    lottie-android and lottie-web has different behavior.

    I am using this json file as input: https://www.gstatic.com/quartz/broadcast/animations/DEFAULT/phase2.json

    This animation has several sub animations, let's say they are A, B, C. A has 60s, B and C has 20s. On android, the B and C will stop after 20s, and A will continue to play until 60s. then they will repeat again. On web, the B and C will repeat immediately after 20s.

    the android code:

        <com.airbnb.lottie.LottieAnimationView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:lottie_rawRes="@raw/phase2"
            app:lottie_loop="true"
            app:lottie_autoPlay="true" />
    

    the web code:

    <div style="width:1067px;height:600px" id="lottie"></div>
    <script>
      var animation = bodymovin.loadAnimation({
        container: document.getElementById('lottie'), 
        path: 'https://www.gstatic.com/quartz/broadcast/animations/DEFAULT/phase2.json', 
        renderer: 'html', 
        loop: true, 
        autoplay: true, 
        name: "Hello World", 
      })
    </script>
    

    How could I solve this problem ? Any response will be greatly appreciated! Thank you!

    Non-Rendering Bug 
    opened by Hawk-Song 0
  • NPE: GradientColor.getColors()

    NPE: GradientColor.getColors()

    java.lang.NullPointerException: Attempt to invoke virtual method 'int[] com.airbnb.lottie.model.content.GradientColor.getColors()' on a null object reference
    at com.airbnb.lottie.animation.content.GradientStrokeContent.getLinearGradient(GradientStrokeContent.java:98)
    at com.airbnb.lottie.animation.content.GradientStrokeContent.draw(GradientStrokeContent.java:75)
    at com.airbnb.lottie.animation.content.ContentGroup.draw(ContentGroup.java:185)
    at com.airbnb.lottie.animation.content.ContentGroup.draw(ContentGroup.java:185)
    at com.airbnb.lottie.model.layer.ShapeLayer.drawLayer(ShapeLayer.java:36)
    at com.airbnb.lottie.model.layer.BaseLayer.draw(BaseLayer.java:250)
    at com.airbnb.lottie.model.layer.CompositionLayer.drawLayer(CompositionLayer.java:128)
    at com.airbnb.lottie.model.layer.BaseLayer.draw(BaseLayer.java:250)
    at com.airbnb.lottie.LottieDrawable.drawDirectlyToCanvas(LottieDrawable.java:1354)
    at com.airbnb.lottie.LottieDrawable.draw(LottieDrawable.java:517)
    at android.widget.ImageView.onDraw(ImageView.java:1529)
    at android.view.View.draw(View.java:21999)
    at android.view.View.updateDisplayListIfDirty(View.java:20859)
    at android.view.View.draw(View.java:21726)
    at android.view.ViewGroup.drawChild(ViewGroup.java:4639)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4386)
    at android.view.View.updateDisplayListIfDirty(View.java:20850)
    at android.view.View.draw(View.java:21726)
    at android.view.ViewGroup.drawChild(ViewGroup.java:4639)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4386)
    at android.view.View.draw(View.java:22002)
    at android.view.View.updateDisplayListIfDirty(View.java:20859)
    at android.view.View.draw(View.java:21726)
    at android.view.ViewGroup.drawChild(ViewGroup.java:4639)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4386)
    at android.view.View.updateDisplayListIfDirty(View.java:20850)
    at android.view.View.draw(View.java:21726)
    at android.view.ViewGroup.drawChild(ViewGroup.java:4639)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4386)
    at android.view.View.updateDisplayListIfDirty(View.java:20850)
    at android.view.View.draw(View.java:21726)
    at android.view.ViewGroup.drawChild(ViewGroup.java:4639)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4386)
    at android.view.View.updateDisplayListIfDirty(View.java:20850)
    at android.view.View.draw(View.java:21726)
    at android.view.ViewGroup.drawChild(ViewGroup.java:4639)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4386)
    at android.view.View.updateDisplayListIfDirty(View.java:20850)
    at android.view.View.draw(View.java:21726)
    at android.view.ViewGroup.drawChild(ViewGroup.java:4639)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4386)
    at android.view.View.draw(View.java:22002)
    at com.android.internal.policy.DecorView.draw(DecorView.java:1173)
    at android.view.View.updateDisplayListIfDirty(View.java:20859)
    at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:583)
    at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:589)
    at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:667)
    at android.view.ViewRootImpl.draw(ViewRootImpl.java:4317)
    at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:4125)
    

    Снимок экрана 2022-12-12 134010

    Please, help.

    Rendering bug 
    opened by danmov26 0
  • NullPointerException: float android.graphics.PointF.x in EllipseContent.java line 86

    NullPointerException: float android.graphics.PointF.x in EllipseContent.java line 86

    java.lang.NullPointerException: Attempt to read from field 'float android.graphics.PointF.x' on a null object reference
           at com.airbnb.lottie.animation.content.EllipseContent.getPath(EllipseContent.java:86)
           at com.airbnb.lottie.animation.content.BaseStrokeContent.draw(BaseStrokeContent.java:201)
           at com.airbnb.lottie.animation.content.StrokeContent.draw(StrokeContent.java:48)
           at com.airbnb.lottie.animation.content.ContentGroup.draw(ContentGroup.java:185)
           at com.airbnb.lottie.animation.content.ContentGroup.draw(ContentGroup.java:185)
           at com.airbnb.lottie.model.layer.ShapeLayer.drawLayer(ShapeLayer.java:36)
           at com.airbnb.lottie.model.layer.BaseLayer.draw(BaseLayer.java:250)
           at com.airbnb.lottie.model.layer.CompositionLayer.drawLayer(CompositionLayer.java:128)
           at com.airbnb.lottie.model.layer.BaseLayer.draw(BaseLayer.java:250)
           at com.airbnb.lottie.LottieDrawable.drawDirectlyToCanvas(LottieDrawable.java:1354)
           at com.airbnb.lottie.LottieDrawable.draw(LottieDrawable.java:517)
           at android.widget.ImageView.onDraw(ImageView.java:1367)
           at android.view.View.draw(View.java:19275)
           at android.view.View.updateDisplayListIfDirty(View.java:18225)
           at android.view.View.draw(View.java:19003)
           at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
           at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4026)
           at android.view.View.updateDisplayListIfDirty(View.java:18216)
           at android.view.View.draw(View.java:19003)
           at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
           at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4026)
           at android.view.View.draw(View.java:19278)
           at android.view.View.updateDisplayListIfDirty(View.java:18225)
           at android.view.View.draw(View.java:19003)
           at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
           at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4026)
           at android.view.View.updateDisplayListIfDirty(View.java:18216)
           at android.view.View.draw(View.java:19003)
           at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
           at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4026)
           at android.view.View.updateDisplayListIfDirty(View.java:18216)
           at android.view.View.draw(View.java:19003)
           at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
           at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4026)
           at android.view.View.updateDisplayListIfDirty(View.java:18216)
           at android.view.View.draw(View.java:19003)
           at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
           at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4026)
           at android.view.View.updateDisplayListIfDirty(View.java:18216)
           at android.view.View.draw(View.java:19003)
           at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
           at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4026)
           at android.view.View.draw(View.java:19278)
           at com.android.internal.policy.DecorView.draw(DecorView.java:788)
           at android.view.View.updateDisplayListIfDirty(View.java:18225)
           at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:676)
           at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:682)
           at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:790)
           at android.view.ViewRootImpl.draw(ViewRootImpl.java:3013)
           at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2817)
           at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2370)
           at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1403)
           at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6790)
           at android.view.Choreographer$CallbackRecord.run(Choreographer.java:966)
           at android.view.Choreographer.doCallbacks(Choreographer.java:778)
           at android.view.Choreographer.doFrame(Choreographer.java:713)
           at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:952)
           at android.os.Handler.handleCallback(Handler.java:790)
           at android.os.Handler.dispatchMessage(Handler.java:99)
           at android.os.Looper.loop(Looper.java:164)
           at android.app.ActivityThread.main(ActivityThread.java:6528)
           at java.lang.reflect.Method.invoke(Method.java)
           at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 
    

    206860693-5e847075-178f-48f8-a652-e850b4948e93

    This user still uses library version 5.2.0

    And here is the code from EllipseContent.java:86

    85: PointF size = sizeAnimation.getValue();
    86: float halfWidth = size.x / 2f;
    87: float halfHeight = size.y / 2f;
    

    It seems that we need to add a check for null here.

    Rendering bug 
    opened by danmov26 7
  • Anchor point and textbox interaction

    Anchor point and textbox interaction

    Lottie is supported and developed on nights and weekends. Issues from Lottie sponsors will be prioritized.

    Checklist

    1. My animation doesn't use any unsupported features. I'm not sure if this counts as anchor point grouping
    2. I know what part of my animation doesn't work. The only differences between the two layers in my text file are with the anchor point(k values on the "a:" attribute), and text box(sz and ps attributes)
    3. I have created a simplified version of my animation anchor_point.txt This has two layers in it that I would expect to line up (about)on top of each other
    4. I have attached the AEP file (as a zip file so it can be attached) that only has the part of the animation that doesn't work. I can get this, but it will take a bit of effort and learning

    Describe the bug When using a text box and an anchor point, the rending doesn't match the behavior of web or iOS

    What version of Lottie did you test this on? 2ca5196e77e0a42136d11a416d69b3fe201b193b (master 12/4/22)

    What version of Android did you test this on? Android 11 pixel 2

    Steps To Reproduce Steps to reproduce the behavior:

    1. load the attached txt file into the sample app

    Screenshots expected(from loading my text file into https://lottiefiles.com/tools/json-editor): Screen Shot 2022-12-06 at 3 17 43 PM

    actual: 1670365020

    Rendering bug 
    opened by ryanhurststrava 0
Releases(v5.2.0)
  • v5.2.0(May 31, 2022)

    Compose Breaking Change LottieAnimation now takes progress as a () -> Float rather than a Float. This allows Lottie to redraw without triggering a recomposition every time progress updates. For more information, refer to the Compose phase docs. The existing API will exist as deprecated for one more release but will then be removed. For the vast majority of use cases:

    LottieAnimation(composition, progress)
    

    will become:

    LottieAnimation(composition, { progress })
    

    or

    LottieAnimation(
      composition = composition,
      progress = { progress }
    )
    

    #2078.

    Bugs Fixed

    • De-dupe gradient stops. On pre-Oreo devices, if you had color and opacity stops in the same place and used hardware acceleration, you may have seen artifacts at the stop positions as of 5.1.1 #20814
    Source code(tar.gz)
    Source code(zip)
  • v5.1.1(Apr 24, 2022)

    5.1.1

    New Features

    • Added support for gradient opacity stops at different points than color stops (#2062)
    • Allow notifying LottieDrawable that system animations are disabled (#2063)

    Bugs Fixed

    • Removed some rounding errors that occurred when setting min/max frames (#2064)
    • Clear onVisibleAction one it is consumed (#2066)
    • Fixed a Xiaomi Android 10 specific crash (#2061)
    • Made LottieAnimationView.start() mimic playAnimation (#2056)
    • Remove @RestrictTo from LottieNetworkFetcher (#2049)
    Source code(tar.gz)
    Source code(zip)
  • v5.0.3(Mar 7, 2022)

  • v5.0.2(Feb 28, 2022)

  • v5.0.1(Feb 22, 2022)

    New Features

    • [Removed API] Removed the setScale(float) APIs from LottieAnimationView and LottieDrawable. The expected behavior was highly ambiguous when paired with other scale types and canvas transformations. For the vast majority of cases, ImageView.ScaleType should be sufficient. For remaining cases, you may apply transformations to Canvas and use LottieDrawable#draw directly.

    • Added support for the "Rounded Corners" effect on Shape and Rect layers (#1953)

    • Prior to 5.0, LottieAnimationView would always call setLayerType with either HARDWARE or SOFTWARE. In the hardware case, this would case Android to allocate a dedicated hardware buffer for the animation that had to be uploaded to the GPU separately. In the software case, LottieAnimationView would rely on View's internal drawing cache.

      This has a few disadvantages:

      • The hardware/software distinction happened at the LottieAnimationView level. That means that consumers of LottieDrawable (such as lottie-compose) had no way to choose a render mode.
      • Dedicated memory for Lottie was always allocated. In the software case, it would be a bitmap that is the size of the LottieAnimationView and in the hardware case, it was a dedicated hardware layer.

      Benefits as a result of this change:

      • Reduced memory consumption. In the hardware case, no new memory is allocated. In the software case, Lottie will create a bitmap that is the intersection of your View/Composition bounds mapped with the drawing transformation which often yields a surface are that is smaller than the entire LottieAnimationView.
      • lottie-compose now supports setting a RenderMode.
      • Custom uses of LottieDrawable now support setting a RenderMode via setRenderMode.
    • Lottie can now render outside of its composition bounds. To allow this with views such as LottieAnimationView, set clipToCompositionBounds to false on LottieDrawable or LottieAnimationView and clipChildren to false on the parent view. For Compose, use the clipToCompositionBounds parameter.

    • Prior to 5.0, LottieAnimationView handled all animation controls when the view's visibility or attach state changed. This worked fine for consumers of LottieAnimationView. However, custom uses of LottieDrawable were prone to leaking infinite animators if they did not properly handle cancelling animations correctly. This opens up the possibility for unexpected behavior and increased battery drain. Lottie now behaves more like animated drawables in the platform and moves this logic into the Drawable via its setVisible API. This should lead to no explicit behavior changes if you are using LottieAnimationView. However, if you are using LottieDrawable directly and were explicitly pausing/cancelling animations on lifecycle changes, you may want to cross check your expected behavior with that of LottieDrawable after this update. This change also resolved a long standing bug when Lottie is used in RecyclerViews due to the complex way in which RecyclerView handles View lifecycles (#1495). #1981

    • Add an API setClipToCompositionBounds on LottieAnimationView, LottieDrawable, and the LottieAnimation composable to prevent Lottie from clipping animations to the composition bounds.

    • Add an API to always render dynamically set bitmaps at the original animation bounds. Previously, dynamically set bitmaps would be rendered at their own size anchored to the top left of the original bitmap. This meant that if you wanted to supply a lower resolution bitmap to save memory, it would render smaller. The default behavior remains the same but you can enable setMaintainOriginalImageBounds to be able to supply lower resolution bitmaps (#1706).

    • Add support for LottieProperty.TEXT to use dynamic properties for text. This enables dynamic text support for lottie-compose (#1995).

    • Add getters for Marker fields (#1998)

    • Add support for reversed polystar paths (#2003)

    Bugs Fixed

    • Fix a rare NPE multi-threaded race condition (#1959)
    • Don't cache dpScale to support moving Activities between different displays (#1915)
    • Fix some cases that would prevent LottieAnimationView or LottieDrawable from being rendered by the Android Studio layout preview (#1984)
    • Better handle animations in which there is only a single color in a gradient (#1985)
    • Fix a rare race condition that could leak a LottieTask object (#1986)
    • Call onAnimationEnd when animations are cancelled to be consistent with platform APIs (#1994)
    • Fix a bug that would only render part of a path if the trim path extended from 0-100 and had an offset (#1999)
    • Add support for languages that use DIRECTIONALITY_NONSPACING_MARK like Hindi (#2001)
    • Prevent LottieAnimationView from overwriting user actions when restoring instance state (#2002)
    Source code(tar.gz)
    Source code(zip)
  • v4.2.1(Nov 12, 2021)

    Features and Improvements

    • Upgraded to Compose 1.0.3 (#1913)
    • Added an overload to TextDelegate that provides layerName (#1931)

    Bugs Fixed

    • Removed some extra Integer allocations with dynamic colors (#1927)
    • Fixed two rare potential NPEs (#1917)
    Source code(tar.gz)
    Source code(zip)
  • v4.2.0(Nov 12, 2021)

  • v4.1.0(Aug 17, 2021)

    • Added support for gaussian blur effects (#1859)
    • Added support for drop shadow effects (#1860)

    BREAKING CHANGES Before this release, drop shadows and blurs were completely ignored. They will now be rendered. In most cases, they will now be rendered correctly. However, you should read the implementation details here if they are not.

    Source code(tar.gz)
    Source code(zip)
  • v4.0.0(Jul 28, 2021)

  • v3.7.2(Jul 18, 2021)

  • compose-1.0.0-rc02-1(Jul 18, 2021)

    • Upgrade to Compose rc02
    • Add support for ContentScale and Alignment just like the Image composable (#1844)
    • Automatically load fonts if possible and allow setting fonts via dynamic properties (#1842)
    • Add LottieCancellationBehavior support to animateLottieCompositionAsState (#1846)
    • Allow custom cache keys/cache skipping (#1847)
    • Always respect LottieClipSpec (#1848)
    Source code(tar.gz)
    Source code(zip)
  • v3.7.1(Jul 8, 2021)

  • compose-1.0.0-rc01-1(Jul 8, 2021)

    Breaking Changes

    LottieAnimation now takes a progress float instead of driving the animation internally. The driving of animations has been split into a new LottieAnimatable class and animateLottieCompositionAsState function. These are analogous to Jetpack's Animatable and animate*AsState functions. Properties that pertain to the animation such as speed, repeat count, and the new clip spec are part of animateLottieComposition whereas properties that are related to rendering such as enabling merge paths and setting an image asset delegate are on the LottieAnimation composable.

    lottieComposition has also been renamed rememberLottieComposition.

    The docs have been update to reflect the new API and there are lots of examples here.

    There are overloaded version of LottieAnimation that merge the properties for convenience. Please refer to the docs for LottieAnimation, LottieAnimatable, animateLottieCompositionAsState and rememberLottieComposition for more information.

    • Added the ability to clip the progress bounds of an animation.
    • Added the ability to set and control dynamic properties.
    • Removed the existing imageAssetDelegate parameter and moved imageAssetsFolder to rememberLottieComposition. Images are now loaded from assets or decoded from the base64 string embedded in the json file during parsing and on the IO thread pool rather than upon first render on the main thread during animations. If you want to supply your own animations, call composition.images["your_image_id"].bitmap = yourBitmap. This lets you control exactly how and when the bitmaps get created and set. The previous implementation of calling a callback on every frame encouraged the incorrect behavior of doing IO tasks during the animation hot path. Check out ImagesExamplesPage.kt for usage.

    Examples

    @Composable
    private fun PlayOnce() {
        val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.heart))
        LottieAnimation(composition)
    }
    
    @Composable
    private fun RepeatForever() {
        val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.heart))
        LottieAnimation(
            composition,
            iterations = LottieConstants.IterateForever,
        )
    }
    
    @Composable
    private fun RepeatForeverWithAnimateLottieCompositionAsState() {
        val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.heart))
        val progress by animateLottieCompositionAsState(
            composition,
            iterations = LottieConstants.IterateForever,
        )
        LottieAnimation(
            composition,
            progress,
        )
    }
    
    @Composable
    private fun RepeatForeverWithLottieAnimatable() {
        val anim = rememberLottieAnimatable()
        val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.heart))
        LaunchedEffect(composition) {
            anim.animate(
                composition,
                iterations = LottieConstants.IterateForever,
            )
        }
        LottieAnimation(anim.composition, anim.progress)
    }
    
    Source code(tar.gz)
    Source code(zip)
  • compose-1.0.0-beta07-1(May 20, 2021)

  • v3.5.0(Nov 9, 2020)

    Features and Improvements

    • Added a new global configuration to add a custom network stack, custom network cache, enable systrace markers, and more (#1629)

      • To use it, checkout the docs for Lottie.initialize and LottieConfig.Builder.
    • Add support for parsing dotLottie files (#1660)

    • Added support for pause listeners on LottieDrawable and LottieAnimationView (#1662)

    Bugs Fixed

    • Properly cache animations loaded via url in memory (#1657)
    Source code(tar.gz)
    Source code(zip)
  • compose-v1.0.0-alpha01(Nov 9, 2020)

    • Initial release of Lottie Compose
    • Compatible with Jetpack Compose alpha 6
    • Built with Lottie 3.5.0
    • Wraps the existing renderer with Jetpack Compose friendly APIs.
    • For up to date docs on how to use it, check out the docs.
    Source code(tar.gz)
    Source code(zip)
  • v3.4.4(Oct 2, 2020)

  • v3.4.2(Aug 28, 2020)

    Feature and Improvements

    • Disable hardware acceleration by default on Android 7.x (#1586)
    • Enable Lottie animations to preview in Android Studio (they may not be accurate, though) (#1572)
    • More leniently parse opacity and colors to render Telegram stickers better ([#1612] (https://github.com/airbnb/lottie-android/pull/1612) and ([#1613](https://github .com/airbnb/lottie-android/pull/1612))
    • Use the correct cacheKey when LottieAnimationView loads an rawRes animation ([#1617] (https://github.com/airbnb/lottie-android/pull/1617))
    • Prevent animations from blinking if they are rendered on multiple threads ([#1575] (https://github.com/airbnb/lottie-android/pull/1575))
    Source code(tar.gz)
    Source code(zip)
  • v3.4.1(Aug 28, 2020)

    Feature and Improvements

    • Added a KeyPath.COMPOSITION constant to set dynamic properties on the animation's root composition layer (#1559).
    • A default style can now be set for all AnimationViews with lottieAnimationViewStyle (#1524).
    Source code(tar.gz)
    Source code(zip)
  • v3.4.0(Feb 22, 2020)

    Features and Improvements

    • Added optional cache key parameters to url loading to enable skipping the cache.
    • Added the ability to clear the Lottie cache via LottieCompositionFactory.clearCache().

    Bugs Fixed

    • Properly pass in progress to ValueCallbacks.
    • Clear existing ValueCallbacks if new ones overwrite old ones.
    • Clip interpolators that might loop back on themself to render something very close rather than crashing.
    • Fix time stretch + time remap when there is a start offset.
    • Ensure that the first frame is rendered when a new composition is set even if it is not yet playing.
    • Properly render Telegram stickers that use [0,1] for color but [0,255] for alpha.
    • Ensure that LottieDrawable has the correct bounds when the composition updates before Marshmallow.
    • Fully clear off screen buffers pre-pie to prevent artifacts.
    • Play, not resume animations if they are played while not shown.
    Source code(tar.gz)
    Source code(zip)
  • v3.3.0(Dec 2, 2019)

    Features and Improvements

    • Added a safeMode API that wraps draw with a try/catch. Can be used for problematic devices #1449.
    • Add support for mask mode none.

    Bugs Fixed

    • Improve the performance of setProgress, particularly for animations with many non-animated properties.
    • Fix a bug where animations may not resume on reattach if their state was saved after they were detached.
    Source code(tar.gz)
    Source code(zip)
  • v3.2.0(Nov 13, 2019)

  • v3.1.0(Oct 15, 2019)

    Features and Improvements

    • Breaking Change Replace JsonReader parsing APIs with InputStream variants to prevent exposing Lottie's copy of Moshi's json parser.
    • Add the ability to catch all Lottie composition errors with setFailureListener and resetFailureListener (#1321).
    • Add the ability to set a fallback drawable res when Lottie fails to parse a composition or load it from the internet. Use setFallbackResource from code orlottie_fallbackRes from xml.
    • Add the ability to render opacity on the layer level rather than the shape level. View the docs for setApplyingOpacityToLayersEnabled for more info.
    • Add the ability to use dynamic properties on text that wasn't already animated.
    • Minor performance optimization when interpolating between colors.

    Bugs Fixed

    • Fix the renderMode attribute from getting overwritten.
    • Prevent masks from either clipping edges or having thin borders pre-Pie.
    • Apply animation scale to dash pattern offsets.
    • Apply animation scale to gradient strokes.
    • Fuzzy match content types when downloading animations from the internet.
    • Prevent a StackOverflowException on KitKat.
    • Prevent resume() from resuming when system animations are disabled.
    • Prevent removeAllUpdateListeners() from removing internally used listeners.
    • Fix some time remap calculations.
    Source code(tar.gz)
    Source code(zip)
  • v3.0.1(Apr 26, 2019)

    Bugs Fixed

    • Fixed an edge case that would resume an animation when it is not shown.
    • Disable animations when the system animation scale is 0.
    • Fall back to hardware rendering when the animation is too large to create a drawing cache.
    Source code(tar.gz)
    Source code(zip)
  • v3.0.0(Apr 26, 2019)

    Features and Improvements

    • Significant mask and matte performance improvements by only calling saveLayer() on the intersection bounds of the content and mask/matte.
    • Added support for dynamic properties on rectangles, gradient colors, and gradient fill opacity.
    • Added support for inverted and intersect masks.
    • Improved support for multiple masks per layer.
    • Added support for optimized bodymovin json with static transforms removed (v5.5.0+).
    • Added support for optimized bodymovin json that will omit duplicated vertex out points to reduce json file size (v5.5.0+).
    • Added support for centered, multiline text, and emojis.
    • Added support for masked text.
    • Added support for skew and skew angle in transforms.
    • Added support for markers. You can now call setMinFrame, setMaxFrame and setMinAndMaxFrame with a marker name.
    • Added support for hidden layers and properties (the eye button in After Effects).
    • Added support for multiple trim paths to be applied on a shape.
    • Removed all memory allocations during playback including autoboxing.
    • Replaced enableHardwareAcceleration with a new setRenderMode API because it has a third (Automatic) option. Refer to the docs for more info.
    • Added an XML attr for animation speed (lottie_speed).
    • Removed the recycleBitmaps() API because it is not neccesary anymore.
    • Prevented invalidateSelf() from being called and recalculating bounds many times per frame.

    Bugs Fixed

    • Only redraw the animation when a value changed. This will have a major impact on animations that are static for part of their playback.
    • Optimized keyframes to recalculate values less frequently
    • Optimized static identity transforms so their matrix doesn't get recalculated on every frame.
    • Ensure that the last frame is played when setMaxFrame is called.
    • Prevent strokes from drawing when the scale is 0.
    • Prevented minFrame from being larger than maxFrame.
    • Return the correct (previous) bitmap when updating the BitmapAssetManager.
    • Properly use the in-memory cache for network animations.
    • Prevented color animations from interpolating before/after the start/end colors even if their interpolator goes <0 or >1.
    • Annotate fetchBitmap() as @Nullable
    • Fixed a bug in the local file cache that would save it with the wrong extensions.
    • Fixed a crash when an animation was missing gradient fill type.
    • Prevent shapes that have different numbers of control points in different keyframes from crashing.
    • Fixed an IndexOutOfBoundsException.
    • Pause Lottie in onVisibilityChanged.
    • Properly limited the LRU cache an enable its maximum size to be configured.
    • Prevented the cache from returning null values after a key was cleared.
    • Properly closed JsonReader in all cases.
    • Fixed text alignment for scaled text when drawn using fonts.
    • Use FutureTask rather than polling for composition parsing to complete.
    • [Sample App] Fixed Lottiefiles integration.
    Source code(tar.gz)
    Source code(zip)
  • v2.6.0-beta21(Aug 29, 2018)

VAP是企鹅电竞开发,用于播放特效动画的实现方案。具有高压缩率、硬件解码等优点。同时支持 iOS,Android,Web 平台。

VAP 简体中文 | English VAP(Video Animation Player)是企鹅电竞开发,用于播放酷炫动画的实现方案。 相比Webp, Apng动图方案,具有高压缩率(素材更小)、硬件解码(解码更快)的优点 相比Lottie,能实现更复杂的动画效果(比如粒子特效) 项目详细介绍请参

Tencent 3.3k Jan 1, 2023
Chandrasekar Kuppusamy 799 Nov 14, 2022
Allows the easy creation of animated transition effects when the state of Android UI has changed

android-transition Android-Transition allows the easy creation of view transitions that reacts to user inputs. The library is designed to be general e

Kai 615 Nov 14, 2022
AndroidPhotoFilters aims to provide fast, powerful and flexible image processing instrument for creating awesome effects on any image media.

PhotoFiltersSDK PhotoFiltersSDK aims to provide fast, powerful and flexible image processing instrument for creating awesome effects on any image medi

Zomato 2.5k Dec 23, 2022
AXrLottie (Android) Renders animations and vectors exported in the bodymovin JSON format. (Using rLottie)

AXrLottie (Android) Renders animations and vectors exported in the bodymovin JSON format. (Using rLottie)

AmirHosseinAghajari 128 Nov 26, 2022
Actions for android animations. Inspired by libgdx scene2d actions.

Android Animations Actions Actions for android animations. Inspired by libgdx scene2d actions. The main goal of this project is making creating of com

dtx12 137 Nov 29, 2022
[] An Android library which allows developers to easily add animations to ListView items

DEPRECATED ListViewAnimations is deprecated in favor of new RecyclerView solutions. No new development will be taking place, but the existing versions

Niek Haarman 5.6k Dec 30, 2022
Android Transition animations explanation with examples.

UNMAINTAINED No maintainance is intended. The content is still valid as a reference but it won't contain the latest new stuff Android Transition Frame

Luis G. Valle 13.6k Dec 28, 2022
An Android library which provides simple Item animations to RecyclerView items

RecyclerViewItemAnimators Library Travis master: This repo provides: Appearance animations Simple animators for the item views Quick start You can now

Gabriele Mariotti 3.1k Dec 16, 2022
Library containing common animations needed for transforming ViewPager scrolling for Android v13+.

ViewPagerTransforms Library containing common animations needed for transforming ViewPager scrolling on Android v13+. This library is a rewrite of the

Ian Thomas 2.5k Dec 29, 2022
The lib can make the ActivityOptions animations use in Android api3.1+

ActivityOptionsICS 本项目停止维护 =========== f you are thinking on customizing the animation of Activity transition then probably you would look for Activit

Kale 591 Nov 18, 2022
Android library to create complex multi-state animations.

MultiStateAnimation Android library to create complex multi-state animations. Overview A class that allows for complex multi-state animations using An

Keepsafe 405 Nov 11, 2022
Circle based animations for Android (min. API 11)

CircularTools Circle based animations for Android (min. API 11) Currently implemented: Circular reveal Circular transform Radial reaction Reveal:YouTu

AutSoft 209 Jul 20, 2022
Lightweight Android library for cool activity transition animations

Bungee min SDK 16 (Android Jellybean 4.1) written in Java A lightweight, easy-to-use Android library that provides awesome activity transition animati

Dean Spencer 172 Nov 18, 2022
Repository for android animations Rx wrapper

RxAnimations RxAnimations is a library with the main goal to make android animations more solid and cohesive. Download compile 'oxim.digital:rxanim:

Mihael Francekovic 479 Dec 30, 2022
A lightweight android library that allows to you create custom fast forward/rewind animations like on Netflix.

SuperForwardView About A lightweight android library that allows to you create custom fast forward/rewind animations like on Netflix. GIF Design Credi

Ertugrul 77 Dec 9, 2022
Add Animatable Material Components in Android Jetpack Compose. Create jetpack compose animations painless.

AnimatableCompose Add Animatable Material Components in Android Jetpack Compose. Create jetpack compose animation painless. What you can create from M

Emir Demirli 12 Jan 2, 2023
Combine ViewPager and Animations to provide a simple way to create applications' guide pages.

WoWoViewPager WoWoViewPager combines ViewPager and Animations to provide a simple way to create applications' guide pages. When users are dragging WoW

Nightonke 2.7k Dec 30, 2022
🍭🚀💗 Tutorials about animations with Animators, Animated Vector Drawables, Shared Transitions, and more

?????? Tutorials about animations with Animators, Animated Vector Drawables, Shared Transitions, and more

Smart Tool Factory 696 Dec 28, 2022