valentinilk / compose-shimmer

A simple shimmer library for Jetpack Compose.
https://valentinilk.github.io/compose-shimmer/
Apache License 2.0
670 stars 37 forks source link

First Shimmer effect start slowly #27

Closed laco-dev closed 7 months ago

laco-dev commented 9 months ago

Hi, I use library very well.

Issue

In generally, API respond about 1 ~ 2seconds. but ShimmerEffect animation wait 1.5seconds below

animationSpec = infiniteRepeatable(
    animation = tween(
        800,
        easing = LinearEasing,
        delayMillis = 1_500, // I can't change `delayMillis`. it is interval time.
    ),
    repeatMode = RepeatMode.Restart,
),

because of this, animation effect doesn't show at first time. I hope to change start delay of first animation.

Thanks.

valentinilk commented 7 months ago

Thanks! Fixed it with 1.3.0

That was something that annoyed me as well. I changed the defaultShimmerTheme to use a custom animation spec instead, which is based on a KeyframesSpec.

Instead of adding the delay to the beginning of the animation, it will now be added end, if you use the newly introduced shimmerSpec or the existing default theme.