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

LottieCompositionFactory: Add factory methods that take an okio Source. #2527

Merged
merged 2 commits into from
Aug 5, 2024

Conversation

vanniktech
Copy link
Contributor

Screenshot 2024-08-04 at 11 33 08

I can't use JsonReader, but since I'm anyway coming from a source, I don't mind and would like to use it right away.

return fromSourceSync(source(stream), cacheKey);
}

public static LottieTask<LottieComposition> fromSource(final Source source, @Nullable final String cacheKey) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

What do you think about naming this fromJsonSource to make it clear that this should be a json file, not zip, gzip, etc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like it. I've tried to see whether I could do the magic bytes check just like you do in other methods but with that Context parameter it gets awkward which is needed for fonts in case they are embedded.

Copy link

github-actions bot commented Aug 5, 2024

Snapshot Tests
API 23: Report Diff
API 31: Report Diff

@gpeal gpeal merged commit a52e6d0 into airbnb:master Aug 5, 2024
7 checks passed
@vanniktech vanniktech deleted the LottieCompositionFactory-fromSource branch August 5, 2024 19:20
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