Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add active_theme_id function #131

Merged
merged 5 commits into from
Apr 10, 2024

Conversation

jk-gan
Copy link
Contributor

@jk-gan jk-gan commented Apr 10, 2024

Changes

  • added active_theme_id method to the DotLottiePlayer, to return the loaded theme id
  • updated multi animations integration tests to ensure the active_theme_id is updated correctly
  • updated uniffi .udl to expose the active_theme_id function to CPP/Kotlin/Swift
  • updated emscripten bindings for WASM

Close #119

I refer @theashraf implementation in #125.

Copy link

changeset-bot bot commented Apr 10, 2024

⚠️ No Changeset found

Latest commit: 1f6e10c

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

Copy link
Member

@theashraf theashraf left a comment

Choose a reason for hiding this comment

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

Thanks, @jk-gan, overall, it looks great!

Just one comment I have:

Loading a new animation should clear the active theme ID, so we need to do that in the following methods:

load_animation_data
load_animation_path
load_dotlottie_data
Also, we can add another assertion to ensure the active_theme_id becomes empty after another load request for both dotLottie and Lottie animations.

@jk-gan jk-gan requested a review from theashraf April 10, 2024 12:49
@jk-gan
Copy link
Contributor Author

jk-gan commented Apr 10, 2024

I've updated the PR @theashraf

dotlottie-rs/tests/theming.rs Outdated Show resolved Hide resolved
demo-player/src/main.rs Show resolved Hide resolved
@jk-gan jk-gan requested a review from theashraf April 10, 2024 15:23
Copy link
Member

@theashraf theashraf left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@jk-gan Thanks for your contribution!

@theashraf theashraf merged commit dfaf166 into LottieFiles:main Apr 10, 2024
1 check passed
@github-actions github-actions bot mentioned this pull request Apr 18, 2024
@github-actions github-actions bot mentioned this pull request May 2, 2024
@github-actions github-actions bot mentioned this pull request May 20, 2024
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.

Add method to retrieve currently loaded theme by its ID in .lottie file
2 participants