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: 🎸 theming #81

Merged
merged 12 commits into from
Mar 11, 2024
Merged

feat: 🎸 theming #81

merged 12 commits into from
Mar 11, 2024

Conversation

theashraf
Copy link
Member

@theashraf theashraf commented Feb 13, 2024

Changes:

dotlottie_core:

  • load_theme: Added to accept a theme_id, enabling it to load and apply a theme from a .lottie file based on its applicability to the currently active animation.
  • load_theme_data: Added to take a JSON string representing the slots object, facilitating the direct application of theme data to the rendering engine.

dotlottie_fms:

  • get_theme: Added to fetch a theme by its id from the .lottie file.

dotlottie_ffi:

  • FFI and WASM Bindings Update: updated the .udl and WASM bindings to include the new load_theme and load_theme_data functions.

Copy link

changeset-bot bot commented Feb 13, 2024

⚠️ No Changeset found

Latest commit: 7f4aed4

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

@theashraf theashraf changed the title feat: 🎸 theming support feat: 🎸 theming Mar 11, 2024
@theashraf theashraf marked this pull request as ready for review March 11, 2024 04:18
Copy link
Collaborator

@afsalz afsalz left a comment

Choose a reason for hiding this comment

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

Awesome 🚀

@@ -978,6 +1009,14 @@ impl DotLottiePlayer {
.retain(|o| !Arc::ptr_eq(o, observer));
}

pub fn load_theme(&self, theme_id: &str) -> bool {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just wondering why we're not utilising setConfig for setting themes as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

@afsalz for consistency with other methods (load_animation & load_animation_data) we use to load internal or external animation assets, a theme is just another asset in the .lottie file. Also, set_config doesn't provide feedback for the success or failure of the operation.

@theashraf theashraf merged commit 07f957c into main Mar 11, 2024
1 check passed
@samuelOsborne samuelOsborne mentioned this pull request Mar 25, 2024
@github-actions github-actions bot mentioned this pull request Apr 3, 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.

2 participants