alexzhirkevich / compottie

Compose Multiplatform library for rendering Lottie animations
MIT License
234 stars 7 forks source link

[Bug]: When `isPlaying=false` the image is blank instead of showing static image. #12

Closed devjn closed 1 month ago

devjn commented 3 months ago

What happened?

When isPlaying=false the image is blank instead of showing static image. I have tested on Android 12. When using airbnb lottie the image is displayed. Here is usage:

        Image(
            modifier = Modifier.padding(end = 16.dp).size(48.dp),
            painter = rememberLottiePainter(
                composition = composition,
                isPlaying = isAnimated,
                iterations = Compottie.IterateForever,
            ),
            contentDescription = "Lottie animation"
        )

Unsupported features

What Compottie version do you experience the bug on?

2.0.0-beta02

What platforms are you seeing the problem on?

Android

Does Compottie log anythyng to the stdout / your logger set with Compottie.logger?

Not sure if it related anyhow, I get:
ImageReader_JNI  W : `Unable to acquire a buffer item, very likely client tried to acquire more than maxImages buffers`
alexzhirkevich commented 3 months ago

Thanks. Reproduced. Does the issue occurs only when progress is zero or in the middle of the animation too?

devjn commented 3 months ago

Even if stopped in the middle

On Tue, Jul 23, 2024, 20:36 Alexander Zhirkevich @.***> wrote:

Thanks. Reproduced. Does the issue occurs only when progress is zero or in the middle of the animation too?

— Reply to this email directly, view it on GitHub https://github.com/alexzhirkevich/compottie/issues/12#issuecomment-2245846470, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEI275HPNBVHXUYWYMHOXSDZN2IDTAVCNFSM6AAAAABLK4BWEOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBVHA2DMNBXGA . You are receiving this because you authored the thread.Message ID: @.***>

alexzhirkevich commented 3 months ago

Can you share reproducible animation for the middle-case? I can only reproduce the first missing frame

devjn commented 3 months ago

Currently I am not able to share, I will try to find. But what I mean by stopping in the middle is that from my example I just update isAnimated = false. So maybe it is just reset to first frame?

devjn commented 3 months ago

You can use this example, I was able to reproduce with it too: https://github.com/spemer/lottie-animations-json/blob/master/ic_fav/ic_fav.json

alexzhirkevich commented 1 month ago

Should be fixed in 2.0.0-rc01

devjn commented 1 month ago

Yes it is fixed, thanks!