Skip to content

fix: 🐛 broken android studio preview#129

Merged
afsalz merged 1 commit into
mainfrom
fix/android-studio-preview
Jun 23, 2026
Merged

fix: 🐛 broken android studio preview#129
afsalz merged 1 commit into
mainfrom
fix/android-studio-preview

Conversation

@afsalz

@afsalz afsalz commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Fixes #39

@changeset-bot

changeset-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: c297e1c

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 addresses Android Studio Compose Preview failures for DotLottieAnimation and DotLottieGLAnimation by short-circuiting native rendering paths when running in inspection (preview) mode, allowing the preview to render the surrounding layout instead of breaking.

Changes:

  • Detects Compose preview via LocalInspectionMode.current and skips DotLottie rendering work.
  • Renders a minimal placeholder Box with a default minimum size during preview to keep the component visible.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
dotlottie/src/main/java/com/lottiefiles/dotlottie/core/compose/ui/DotLottieGLAnimation.kt Adds an inspection-mode early return with a placeholder Box to avoid preview-time GL/AndroidView rendering.
dotlottie/src/main/java/com/lottiefiles/dotlottie/core/compose/ui/DotLottieAnimation.kt Adds an inspection-mode early return with a placeholder Box to avoid preview-time player/JNI initialization and rendering.

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

@afsalz
afsalz merged commit 2feeec4 into main Jun 23, 2026
2 checks passed
@afsalz
afsalz deleted the fix/android-studio-preview 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.

DotLottie Animation does not allow preview

3 participants