Skip to content

Usage

Create a folder called xml-images in the module folder.

:module/xml-images

Android

Captura de pantalla 2024-01-05 a las 16 57 56

Multiplatform

Captura de pantalla 2024-01-05 a las 17 10 28

Generate images

You can manually generate ImageVector for these XML files by calling gradle generateImages. This will create a Kotlin file for each XML file containing the ImageVector in the build folder.

Captura de pantalla 2024-01-05 a las 17 00 45

Now, you can use reference this image in the Compose code:

Icon(Images.Icons.Add, contentDescription = null)

Note that automatically a category called "Icons" has been created. A category is created for each subfolder in xml-images folder.