Hi, I use Lottie 2.7.0 and I have a Recyclerview where each item has a LottieAnimationView that play animation when create. So, when I have 20 items (for example) in my Recyclerview and make scroll, the animation in the first items isstopped. I detect with a AnimatorListener that each item enter in onAnimationCancel () when stop.
The problem is, how to work with Recyclerview when each item has animation and all the animations are executed at the same time? And, how not stop animations when scroll the Recyclerview?
PD: If my ViewHolder has setIsRecyclable (false) the problem is solved, all animations play same time and not stopeed, but the scroll is very slow.
Thanks
The solution is overried onViewRecycled() and cancel the animation as:
lottieImage.cancelAnimation()
val drawable = containerView.videoStatus.drawable
if (drawable is LottieDrawable) {
drawable.clearComposition()
}
Dont edit setIsRecyclable (false)
Most helpful comment
The solution is overried onViewRecycled() and cancel the animation as:
Dont edit
setIsRecyclable (false)