-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: 🎸 theming #81
Conversation
|
There was a problem hiding this 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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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 itsid
from the .lottie file.dotlottie_ffi:
load_theme
andload_theme_data
functions.