I'm using a LottieAnimationView in an Android app....
# android
r
I'm using a LottieAnimationView in an Android app. I want to use a cached version so performance is better and the JSON parsing does not show a short flicker. Problem is I want to use a negative speed (which will play the animation backwards) based on a boolean condition
my code looks like this:
Copy code
if (isFavorite) {
        binding.favoriteLottieIcon.apply {
            LottieCompositionFactory.fromRawRes(context, R.raw.ic_favorite_luister)
            speed = -2F
            playAnimation()
        }
    } else {
        binding.favoriteLottieIcon.apply {
            LottieCompositionFactory.fromRawRes(context, R.raw.ic_favorite_luister)
            speed = 2F
            playAnimation()
        }
    }
}
Anyone knows if it is possible to change the speed of a cached LottieAnimationView?
docs:
image.png
finally fixed it by setting .progress to 0.99F so there is no need to set an image resource before the animation reverse plays