diff --git a/README.md b/README.md index 432938c25..fcac3e6e3 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ needs. - π [IntelliJ IDEA / Android Studio plugin](#idea-plugin) - π₯οΈ [CLI tool](#cli-tool) - π [Gradle plugin](#gradle-plugin) -- Web app (π§ under development π§) +- π Web app (π§ under development π§) ## Table of Contents @@ -56,12 +56,17 @@ needs. - [Plugin features](#plugin-features) - [Simple mode](#simple-mode) - [IconPack mode](#iconpack-mode) - - [Create new icon pack](#new-icon-pack) - - [Update existing icon pack](#existing-icon-pack) + - [New pack](#new-pack) + - [Existing pack](#existing-pack) + - [Material pack](#material-pack) + - [Web Import](#web-import) + - [SVG to XML](#svg-to-xml) + - [ImageVector to XML](#imagevector-to-xml) - [ImageVector previewer](#imagevector-previewer) - [Embedded previewer](#embedded-previewer) - [AutoCompletion previewer](#autocompletion-previewer) - [Gutter previewer](#gutter-previewer) + - [Project view previewer](#project-view-previewer) - [Requirements](#requirements) - [Installation](#installation) - [Build plugin](#build-plugin) @@ -109,108 +114,193 @@ needs. - Support for Drag&Drop files/directories and pasting content from clipboard - Easy option to add more icons into existing project icon pack - Copy generated ImageVector to clipboard or file (depends on the mode) -- Fully customizable setting for generated icons +- Fully customizable settings for generated icons - Build-in [ImageVector previewer](#imagevector-previewer) for any icons without compilation β¨ -- The plugin is completely built using [Compose Multiplatform](https://github.com/JetBrains/compose-multiplatform) - and [Tiamat](https://github.com/ComposeGears/Tiamat) navigation library +- [Web Import](#web-import): directly download and convert icons from popular online icon libraries +- [SVG to XML](#svg-to-xml) conversion tool +- [ImageVector to XML](#imagevector-to-xml) backward conversion tool +- Built entirely with [Compose Multiplatform](https://github.com/JetBrains/compose-multiplatform); since version 1.0.0 + powered by the [Jewel](https://github.com/JetBrains/intellij-community/tree/master/platform/jewel) + UI framework and [Tiamat](https://github.com/ComposeGears/Tiamat) for navigation -More exclusive features under development, stay tuned π +### Simple mode -### **Simple mode** - -> [!NOTE] -> One-click solution to convert SVG/XML to ImageVector (requires only specifying the package). +Quick conversion of individual SVG/XML icons to ImageVector format. Perfect for one-off conversions, prototyping, or +testing icons without setting up a full icon pack structure. #### Available quick actions: - Rename icon -- Preview current ImageVector -- Copy generated ImageVector to clipboard +- Preview `ImageVector` on different backgrounds (pixel grid, white, black) +- Export generated `ImageVector` to file or copy to clipboard
-
-
+
+
+
+
+
+
+Key options:
+
+| Option | Default | Description |
+|------------------------------|--------------------|--------------------------------------------------------------------|
+| `--input-path` | *(required)* | Directory with SVG/XML files or path to a single file |
+| `--output-path` | *(required)* | Output directory for generated sources |
+| `--package-name` | *(required)* | Package name of the generated sources |
+| `--iconpack-name` | `""` | Name of the existing IconPack |
+| `--nested-pack-name` | `""` | Name of the existing nested IconPack |
+| `--output-format` | `backing-property` | `backing-property` or `lazy-property` |
+| `--use-compose-colors` | `true` | Use predefined Compose colors instead of hex codes |
+| `--generate-preview` | `false` | Generate `@Preview` function |
+| `--flatpackage` | `false` | Import all icons into a single package |
+| `--explicit-mode` | `false` | Add explicit `public` modifier |
+| `--trailing-comma` | `false` | Insert trailing comma in path params |
+| `--use-path-data-string` | `false` | Generate `addPath` with pathData strings instead of builder calls |
+| `--suppress-unused-receiver` | `false` | Add `@Suppress("UnusedReceiverParameter")` to extension properties |
+| `--indent-size` | `4` | Spaces per indentation level |
+| `--auto-mirror` | *(not set)* | Force `autoMirror=true` or `autoMirror=false` on all icons |
+| `-v`, `--verbose` | `false` | Print additional info logs |
+
Demo:
https://github.com/user-attachments/assets/1e1d07bd-080f-4d39-8683-c1c30ef905e8
@@ -371,10 +482,10 @@ ideal for projects that need to version control icon sources and generate type-s
### Compatibility
-| Valkyrie plugin version | Min AGP | Min Gradle |
-|-------------------------|---------|-------------------------|
-| 0.4.0 | 9.0.0 | 9.0.0 (should be lower) |
-| 0.5.0 | 9.2.0 | 9.4.1 |
+| Valkyrie plugin version | Min AGP | Min Gradle |
+|-------------------------|---------|------------|
+| 0.4.0 | 9.0.0 | 9.0.0 |
+| 0.5.0 | 9.2.0 | 9.4.1 |
### Common scenarios
@@ -456,6 +567,10 @@ valkyrie {
// Insert a trailing comma after the last element of ImageVector.Builder block and path params (default: false)
addTrailingComma = false
+ // Generate addPath with pathData strings instead of path builder calls (default: false)
+ // Less optimal due to pre-rendering parsing, but may be preferred for readability
+ usePathDataString = false
+
// Add `@Suppress("UnusedReceiverParameter")` annotation to generated ImageVector extension properties (default: false)
// Suppresses the Kotlin warning when the receiver parameter (e.g. `ValkyrieIcons`) is not used inside the property getter body
suppressUnusedReceiverWarning = false
diff --git a/assets/iconpack_mode.png b/assets/iconpack_mode.png
new file mode 100644
index 000000000..3b4c5969b
Binary files /dev/null and b/assets/iconpack_mode.png differ
diff --git a/assets/iconpack_mode_existing_1.png b/assets/iconpack_mode_existing_1.png
index 4c04b041c..c2b6aba56 100644
Binary files a/assets/iconpack_mode_existing_1.png and b/assets/iconpack_mode_existing_1.png differ
diff --git a/assets/iconpack_mode_existing_2.png b/assets/iconpack_mode_existing_2.png
index 717a5f1c1..97e619c4d 100644
Binary files a/assets/iconpack_mode_existing_2.png and b/assets/iconpack_mode_existing_2.png differ
diff --git a/assets/iconpack_mode_existing_3.png b/assets/iconpack_mode_existing_3.png
new file mode 100644
index 000000000..100978ed1
Binary files /dev/null and b/assets/iconpack_mode_existing_3.png differ
diff --git a/assets/iconpack_mode_material_1.png b/assets/iconpack_mode_material_1.png
new file mode 100644
index 000000000..144ca58bb
Binary files /dev/null and b/assets/iconpack_mode_material_1.png differ
diff --git a/assets/iconpack_mode_material_2.png b/assets/iconpack_mode_material_2.png
new file mode 100644
index 000000000..d57a8f8f0
Binary files /dev/null and b/assets/iconpack_mode_material_2.png differ
diff --git a/assets/iconpack_mode_material_3.png b/assets/iconpack_mode_material_3.png
new file mode 100644
index 000000000..1bed6de3a
Binary files /dev/null and b/assets/iconpack_mode_material_3.png differ
diff --git a/assets/iconpack_mode_new_1.png b/assets/iconpack_mode_new_1.png
index 1c50ac8ba..bbca4a278 100644
Binary files a/assets/iconpack_mode_new_1.png and b/assets/iconpack_mode_new_1.png differ
diff --git a/assets/iconpack_mode_new_2.png b/assets/iconpack_mode_new_2.png
index 405c1bedb..c66f758f5 100644
Binary files a/assets/iconpack_mode_new_2.png and b/assets/iconpack_mode_new_2.png differ
diff --git a/assets/iconpack_mode_new_3.png b/assets/iconpack_mode_new_3.png
new file mode 100644
index 000000000..081733b89
Binary files /dev/null and b/assets/iconpack_mode_new_3.png differ
diff --git a/assets/imagevector_previewer.png b/assets/imagevector_previewer.png
index 5af6d4e7c..f93ddaa6e 100644
Binary files a/assets/imagevector_previewer.png and b/assets/imagevector_previewer.png differ
diff --git a/assets/imagevector_previewer_autocomplete.png b/assets/imagevector_previewer_autocomplete.png
index 637582528..95932090e 100644
Binary files a/assets/imagevector_previewer_autocomplete.png and b/assets/imagevector_previewer_autocomplete.png differ
diff --git a/assets/imagevector_previewer_gutter.png b/assets/imagevector_previewer_gutter.png
index 463ced171..eea794c28 100644
Binary files a/assets/imagevector_previewer_gutter.png and b/assets/imagevector_previewer_gutter.png differ
diff --git a/assets/imagevector_previewer_project_view.png b/assets/imagevector_previewer_project_view.png
new file mode 100644
index 000000000..87c475921
Binary files /dev/null and b/assets/imagevector_previewer_project_view.png differ
diff --git a/assets/simple_mode_1.png b/assets/simple_mode_1.png
index 41dcf573b..e5a529a42 100644
Binary files a/assets/simple_mode_1.png and b/assets/simple_mode_1.png differ
diff --git a/assets/simple_mode_2.png b/assets/simple_mode_2.png
index b3ee27101..1d88d9c7a 100644
Binary files a/assets/simple_mode_2.png and b/assets/simple_mode_2.png differ
diff --git a/assets/simple_mode_3.png b/assets/simple_mode_3.png
index 6105e89b2..bf6ac40cb 100644
Binary files a/assets/simple_mode_3.png and b/assets/simple_mode_3.png differ