parse

Parses xml as either Android Vector or SVG and returns the resolved image.

The format is auto-detected from the root element name — <vector> for the Android format, <svg> for SVG. Throws IllegalArgumentException if the root element is neither, or VectorParseException if the XML / path data is malformed.

Parameters

xml

the source XML as a string. Typically loaded from the app's assets, the network, or hard-coded for icons.