KSVGSvgDrawableTranscoder

class KSVGSvgDrawableTranscoder : ResourceTranscoder<SVG, Drawable>

Creates a fresh Drawable from a cached SVG document on every call.

Drawables own a per-view mutable state (scene, pools, bounds, animation clock), so sharing one instance across targets is unsafe. Transcoding runs per request — including per memory-cache key (Glide keys include the target size), which is what gives each target its own drawable.

If animations are enabled via KSVGOptions.PARSE_ANIMATIONS and the parsed document actually contains animations (SVG.hasAnimations), the result is a hu.oandras.ksvg.KSVGAnimatedDrawable; otherwise it is a plain hu.oandras.ksvg.KSVGDrawable, which renders identically for static documents without owning an animation clock.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open override fun transcode(toTranscode: Resource<SVG>, options: Options): Resource<Drawable>