airbnb / lottie-android

Render After Effects animations natively on Android and iOS, Web, and React Native
http://airbnb.io/lottie/
Apache License 2.0
34.95k stars 5.4k forks source link

Placeholder Support while Lottie is being fetched / rendered #2436

Closed ShivamGoyal1899 closed 8 months ago

ShivamGoyal1899 commented 8 months ago

Lottie is supported and developed on nights and weekends. Issues from Lottie sponsors will be prioritized.

Is your feature request related to a problem? Please describe. While Lottie is being fetched over the internet or rendered, there is no visual cue for the user to know that it's being fetched or rendered.

Describe the solution you'd like A placeholder option similar to Glide will be helpful. I'm specifically looking to be able to add a Vector Drawable in such cases.

Describe alternatives you've considered No alternatives were found.

gpeal commented 8 months ago

LottieAnimationView is just an ImageView. Whenever you call setAnimationFromUrl, you can also call setImageDrawable at the same time and then Lottie will re-set it to the animation when it loads or fails.

This should work but feel free to reopen this if it doesn't.