Skip to content

Animation disappears inside RecyclerView when using custom FrameLayout with DotLottieAnimation #85

Description

@serhatbekirak

I created a custom AnimationView (derived from FrameLayout) that internally uses com.lottiefiles.dotlottie.core.widget.DotLottieAnimation.
This view is displayed inside a RecyclerView item.

When I click on a list item or when the item gets rebound (onBindViewHolder), the animation suddenly disappears.
In the logs, the onDestroy() event is triggered, even though the view is still attached to its parent.

It seems like DotLottieAnimation triggers a premature destroy() during temporary detachment or recycling.

How can I fix this issue?
How can I prevent DotLottieAnimation from calling onDestroy() during temporary detach (e.g., RecyclerView recycling)?
I tried filtering the event in my FrameLayout wrapper, but the animation still disappears.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions