Transforming Android XML Vector drawables into Compose Multiplatform ImageVectors

Compose Vectorize is a Kotlin Multiplatform library to generate compose.ui.graphics.vector.ImageVector from XML files. It is built on top of AndroidX material-icons vector generator, but it allows transforming not only solid plain icons but also illustrations and creates categories for resources automatically based on folder structure. How to use First, add the gradle plugin in your project. Inside plugins{} block in build.gradle root file. plugins { id("dev.sergiobelda.compose.vectorize") version "$VERSION" apply false } To use the generated ImageVectors, you must add the compose-vectorize-core dependency to your project. Depending on whether your project is Kotlin Multiplatform or not, add the following dependency to the dependencies block. ...

February 5, 2024 · 2 min · Sergio Belda