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
Fabric support for iOS #955
Conversation
@AlexanderEggers, here's what I have so far. The fabric example works, but I still have to figure out a |
@AlexanderEggers I tested on Android and it seems like it's accepting the structs. The problem I see now is I get this error when the animation ends |
@emilioicai @AlexanderEggers @matinzd I think the PR is ready! |
62d67b3
to
b74c074
Compare
I am going to test it this weekend. Thanks for the PR! |
Happy New Year! @matinzd, did you have a chance to test it? |
I am going to test this tonight. 🚀 |
I ran into some issues while building and testing it last night. I will give more update on it later today. |
I think the This behavior happened on both iOS and Android. |
I think we might need to refactor javascript code as well. There are some deprecated methods used in our js files. |
@matinzd, which deprecated methods are you referring to? I'd be happy to refactor those. |
Sorry, my bad. I thought we are still using |
I'm not sure why that's happening on Fabric when using fast reload. It's related to the native component having a ref. I couldn't reproduce the issue when removing the ref from the native component in |
@matinzd, let me know when you can test my findings. I'll investigate further what's going on with the refs. |
Ok, I found the issue. According to this note first callback of ref will be initiated as _captureRef(ref: React.ElementRef<typeof NativeLottieAnimationView>) {
+ if (ref === null) {
+ return
+ }
this._lottieAnimationViewRef = ref;
if (this.props.autoPlay === true) {
this.play();
}
} |
I think this makes sense. I don't see any issues with not assigning the ref until it's not null. |
I added color filters to the example. I see those working fine on iOS. Android is not getting them. |
Android is getting the values and assigning a color filter. I think the problem is that the color filter keypath for Android is not the same than for iOS. |
@matinzd have you tried using a lottie animation that includes a text before? I tried one that uses Roboto font and it crashes on Android since the font is not there. I tried adding it to |
Hey @alfonsocj , |
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.
Looks good! 🚀
Summary
Adding Fabric support for iOS.
LottieAnimationViewComponentView
objective-c++ class that uses existingContainerView.swift
.