Skip to content

Fix/recycler view#128

Merged
afsalz merged 3 commits into
mainfrom
fix/recycler-view
Jun 23, 2026
Merged

Fix/recycler view#128
afsalz merged 3 commits into
mainfrom
fix/recycler-view

Conversation

@afsalz

@afsalz afsalz commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Solves
#45
#85

@changeset-bot

changeset-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 67543e5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR targets RecyclerView lifecycle problems with DotLottieAnimation (crashes during fast scrolling and animations disappearing after recycling) by reworking when the drawable/setup work is (re)triggered across attach/detach, and bumps the module version for release.

Changes:

  • Re-initialize the internal coroutine scope when needed and avoid redundant setup calls.
  • Trigger drawable setup on onAttachedToWindow() when the view is (re)attached and size is known (or after layout).
  • Bump dotlottie module version to 0.14.1.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
dotlottie/src/main/java/com/lottiefiles/dotlottie/core/widget/DotLottieAnimation.kt Adds attach-time setup and scope reactivation logic to improve RecyclerView reuse behavior.
dotlottie/build.gradle.kts Version bump to publish the fix.
Comments suppressed due to low confidence (1)

dotlottie/src/main/java/com/lottiefiles/dotlottie/core/widget/DotLottieAnimation.kt:391

  • setupConfigJob is cancelled in onDetachedFromWindow(), but DotLottieUtils.getContent(...) is suspension-based (callback) and may still resume after cancellation. Without a guard, this coroutine can still assign a new mLottieDrawable after the view is detached, racing with release() and potentially reproducing the SIGSEGV/crash this PR is trying to fix. Add an early return after getContent when the coroutine is no longer active or the view is not attached.
            runCatching {
                val content = DotLottieUtils.getContent(context, config.source)
                mLottieDrawable = DotLottieDrawable(

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@afsalz
afsalz merged commit 70d6eba into main Jun 23, 2026
1 check passed
@afsalz
afsalz deleted the fix/recycler-view branch June 23, 2026 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Animation disappears inside RecyclerView when using custom FrameLayout with DotLottieAnimation Animation inside recyclerView issues

3 participants