Skip to content

Commit

Permalink
fix(documentation): improve adaptive icons description
Browse files Browse the repository at this point in the history
release-npm
  • Loading branch information
tobua committed Dec 20, 2022
1 parent b1fcd64 commit 1e8dc49
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Numic plugin for React Native to automatically generate iOS and Android app icon

## Installation

This plugin requires the project is managed through [numic](https://npmjs.com/numic).

```
npm i --save-dev icon-numic-plugin
```
Expand Down Expand Up @@ -46,9 +48,16 @@ The icon can be configured in `package.json` under the `numic` property. This wi

## Adaptive Icons for Android

Adaptive icons use vector graphics and are composed of a foreground icon and a background image. Due to using vector graphics only one image is required. Using this plugin will also generate all the required configuration files as well as the default legacy icons for older devices.
Adaptive icons use vector graphics and are composed of a foreground and a background image. Due to using vector graphics only one image size is required. This plugin will generate all the required configuration files as well as the scaled legacy images in various sizes for older devices.

For web developers the easiest way to generate the vector drawables used on Android for adaptive icons is to convert from an SVG.
For web developers the easiest way to generate the vector drawables used on Android for adaptive icons is to convert from an SVG. The vector drawable specification is largely the same as SVG so this plugin is able to take SVG icons as input and convert them to XML files in the Android Drawable syntax. It's also possible to directly pass in XML files that are already in the vector drawable format. To generate vector drawables from scratch or debug the output of the conversion from SVG by this plugin, open the `/android` folder in Android Studio. There it's possible to edit and directly preview the images. To get a preview of the resulting images for various Android versions click `Resource Manager` on the left -> `+` icon -> `Image Asset`

When using the default Andriod XML format to create the images it's best to do this in Android Studio. Opening the `/android` folder there will allow a direct preview of the graphics.
<p align="center">
<img src="https://github.com/tobua/icon-numic-plugin/raw/main/image/image-asset.png" width="80%" alt="Adaptive Icon preview in Android Studio" />
</p>

<p align="center">
<a href="https://npmjs.com/react-native-adaptive-icons">
<img src="https://github.com/tobua/icon-numic-plugin/raw/main/image/nice-try.png" width="80%" alt="ChatGPT's attempt at Adaptive Icons for React Native" />
</a>
</p>
Binary file added image/image-asset.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/nice-try.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"get-pixels": "^3.3.3",
"jest-fixture": "^3.0.1",
"padua": "^0.6.1",
"vitest": "^0.25.8"
"vitest": "^0.26.1"
},
"prettier": "padua/configuration/.prettierrc.json",
"eslintConfig": {
Expand Down

0 comments on commit 1e8dc49

Please sign in to comment.