-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
How to use with JsonReader? #1270
Comments
@AndroidDeveloperLB Hmm, this was an unintended consequence of us switching out the underlying JsonReader for performance and to fix some OEM specific crashes. I'll expose the InputStream version then you can do |
What is the best way to handle the InputStream ? Is this currently possible ? |
You can use |
You probably mean But what do I do with it exactly? It looks like a background task. I want to set the animation of the All I want is that it will load and show the animation from the inputStream. Let it load later however it needs in the background. |
@AndroidDeveloperLB You can add a listener on the task then call |
I want to set the animation and let the View handle it, just like any other source of animation. If I use a listener, I will need to somehow manage this situation, because I can't just tell it to set the animation when it's done, as there might be a different animation being set between the time I started to the time I got a callback from the listener. Can you please show how to use what you wrote? |
@AndroidDeveloperLB As I mentioned, I am going to add an |
In the mean time, you could also convert it to a String and pass the json string in. Not ideal but I'll fix this soon. |
Can you please let me know after it gets fixed? |
So which version to use, that allows to use InputStream? |
The next release, it'll likely by 3.1.0. I hope to release it this week. |
What's the best way for now, then, to set animation from File (or file path) ? |
Is it this:
? |
Right now, read the file as a string then pass it to |
Does setAnimationFromUrl work fine with filePath as I wrote? |
@AndroidDeveloperLB No because a file is not a network url. |
@gpeal I see. In the docs they say as if it's a normal file, so I thought it can be used too. |
@gpeal So for now it's possible to do as such:
? |
@AndroidDeveloperLB or |
@gpeal There is no such thing: And if you mean |
@AndroidDeveloperLB Yes, |
I see. Sadly due to this issue: I hope next version will fix this, and also provide a nicer way to handle what I wrote here. |
On v3.0.3 , I could use this:
But when I've recently updated to 3.0.6 , it says I need to use
com.airbnb.lottie.parser.moshi.JsonReader
instead.It doesn't seem like the normal JsonReader , and I can't pass it what I've passed to it.
How can I use the new JsonReader of Lottie? What should I do?
The text was updated successfully, but these errors were encountered: