Is there anything for rendering animated SVGs from...
# compose
z
Is there anything for rendering animated SVGs from a file during runtime without a webview? I can only find ways to render static SVGs
g
You need to use Android Animated Vector drawable or Lotti
s
Coil seems to have animated GIF support through an extension, though I haven't used it myself. https://coil-kt.github.io/coil/gifs/
g
Gif on Coil works fine, we use it, but it's not vector unlike lotti or android AnimatedVectorDrawable, and also obviously not so smooth as an actual animation
s
Right. But there are cases where one cannot use AVDs or Lottie, such as when being served a file from somewhere else.
g
Sure, but it's kinda unfortunate situation which doesn't work well on Android. If you do not control SVG, there is no way to display it without webview reliably, one can try to use path and generate animation from it (so Vector Drawable but on runtime), but it's very limited approach, will work with simple cases only, exactly what AnimatedVectorDrawable is doing
👍 1
e
You can use lottie when being served from somewhere else 🙂. It has both a json format & a zip format that can be downloaded & loaded