Lottie-android: Request: allow to view a single animation frame in layout editor

Created on 9 Apr 2018  路  9Comments  路  Source: airbnb/lottie-android

Currently, if I use LottieAnimationView in XML, that has its lottie_rawRes defined, I still see an empty content.

Please allow to view it somehow in the layout editor.

Maybe add tools:frameToShow attribute, to let us choose which frame of the animation to show on the layout editor.

Good first issue Help wanted

Most helpful comment

What am I seeing?
And why close it? Have you added this feature?

All 9 comments

I would accept a PR for this.

Is it possible though?

@AndroidDeveloperLB No idea. I haven't tried. Do you know?

Well the docs don't talk about getting a single frame from the animation:
http://airbnb.io/lottie/android/android.html#sample-app
I've also tried to search for "bitmap" in the project, but I don't think any of what I've seen allows to get a single image out of a single frame from the Lottie animation.

So this is why I asked about it...

Maybe consider adding an API to get a single Bitmap from a given animation?

There is a setFrame API.

If the layout preview only renders bitmaps then that will be out of the scope of Lottie. I think the layout preview can actually render a set of Android drawing commands so it may actually be able to just render it.

Even better. You mean I can get a Drawable out of a specific frame of it?

@AndroidDeveloperLB Just tried forcing the layout preview to render Lottie and it seems like its rendering is clearly limited in functionality. This is what the lottie logo looks like:
image

What am I seeing?
And why close it? Have you added this feature?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lawloretienne picture lawloretienne  路  5Comments

Anmolk22 picture Anmolk22  路  3Comments

nick1Jian picture nick1Jian  路  3Comments

dpmaycry picture dpmaycry  路  3Comments

anitoledo picture anitoledo  路  4Comments