Skip to content

Commit

Permalink
Merge branch 'main' into update_dependencies_kotlin_1.9.23
Browse files Browse the repository at this point in the history
# Conflicts:
#	gradle/libs.versions.toml
  • Loading branch information
serbelga committed Mar 17, 2024
2 parents 03e3533 + 3ec3ce0 commit 2f201f0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,29 @@
[![Maven Central](https://img.shields.io/maven-central/v/dev.sergiobelda.compose.vectorize/compose-vectorize-core)](https://search.maven.org/search?q=g:dev.sergiobelda.compose.vectorize)

A Kotlin Multiplatform library to generate `compose.ui.graphics.vector.ImageVector` from
XML files. This library has the same behavior as AndroidX `material-icons` vector generator.

Converts the XML files located in the `xml-images` folder and creates categories based on the folder division.
`.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.

<img src="./docs/assets/diagram.png" alt="Compose Vectorize diagram">

## Themed Attributes

It also supports theme attributes. If you are using theme color attributes, like `?attr/colorPrimary` or `?attr/colorSecondary`, they can be converted to Compose `MaterialTheme` tokens, which means that you can update illustration colors based on the token values. It is also compatible with Material3 dynamic colors.

```xml
<path
android:pathData="..."
android:fillColor="?attr/colorPrimary"/>
```

<div>
<img width="220" alt="Screenshot_20240310_145842" src="https://github.com/serbelga/compose-vectorize/assets/26246782/73ebdb93-fbaf-454f-aaa2-bf17d9d2dff1">
<img width="220" alt="Screenshot_20240310_145842-2" src="https://github.com/serbelga/compose-vectorize/assets/26246782/b282aff3-599b-4039-9455-247eed7befc2">
<img width="220" alt="Screenshot_20240310_145842-1" src="https://github.com/serbelga/compose-vectorize/assets/26246782/e2a10a2e-1eb4-40af-be1e-aeaac1954f23">
</div>

> [!NOTE]
> It requires use Compose Material 3 dependency.
## How to Use

- [Android](#android)
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ androidCompileSdk = "34"
androidCore = "1.12.0"
androidMinSdk = "24"
androidTargetSdk = "34"
androidGradlePlugin = "8.2.2"
androidGradlePlugin = "8.3.0"
composeBom = "2024.02.02"
composeCompiler = "1.5.10"
composeMultiplatform = "1.6.1"
Expand Down

0 comments on commit 2f201f0

Please sign in to comment.