Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 711 Bytes

README.md

File metadata and controls

19 lines (14 loc) · 711 Bytes

SVGs

To add SVG support, import the extension library:

implementation("io.coil-kt:coil-svg:2.0.0")

And add the decoder to your component registry when constructing your ImageLoader:

val imageLoader = ImageLoader.Builder(context)
    .components {
        add(SvgDecoder.Factory())
    }
    .build()

The ImageLoader will automatically detect and decode any SVGs. Coil detects SVGs by looking for the <svg marker in the first 1 KB of the file, which should cover most cases. If the SVG is not automatically detected, you can set the Decoder explicitly to SvgDecoder for the request.