Skip to content
This repository has been archived by the owner on Oct 19, 2020. It is now read-only.

✨ Added mipmap ic-launcher png generation #134

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ For good results, your file should be:

#### Notes:

- Your `config.ml` file will not be updated by the tool (because images are automatically created in the good folders)
- Your `config.xml` file will not be updated by the tool (because images are automatically created in the good folders)
- Therefore, in your `config.xml`, be sure to remove all lines looking like `<icon src="res/android/ldpi.png" density="ldpi" />`

### Creating a cordova-cli hook
Expand All @@ -72,6 +72,13 @@ Then give the script +x permission:

That's it. Now every time you `cordova build`, the icons will be auto generated.

### Android Adaptive Icons
If you wish to use `png`s instead of adaptive icons, add the following to your hook:
```
cordova-icon
rm -rf platforms/android/app/src/main/res/mipmap-*-v26
```

### Splash screens

Check out [cordova-splash](https://github.com/AlexDisler/cordova-splash)
Expand Down
12 changes: 6 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ var getPlatforms = function (projectName) {
{ name : 'drawable-xhdpi/icon.png', size : 96 },
{ name : 'drawable-xxhdpi/icon.png', size : 144 },
{ name : 'drawable-xxxhdpi/icon.png', size : 192 },
{ name : 'mipmap-hdpi/icon.png', size : 72 },
{ name : 'mipmap-ldpi/icon.png', size : 36 },
{ name : 'mipmap-mdpi/icon.png', size : 48 },
{ name : 'mipmap-xhdpi/icon.png', size : 96 },
{ name : 'mipmap-xxhdpi/icon.png', size : 144 },
{ name : 'mipmap-xxxhdpi/icon.png', size : 192 }
{ name : 'mipmap-hdpi/ic_launcher.png', size : 72 },
{ name : 'mipmap-ldpi/ic_launcher.png', size : 36 },
{ name : 'mipmap-mdpi/ic_launcher.png', size : 48 },
{ name : 'mipmap-xhdpi/ic_launcher.png', size : 96 },
{ name : 'mipmap-xxhdpi/ic_launcher.png', size : 144 },
{ name : 'mipmap-xxxhdpi/ic_launcher.png', size : 192 }
]
});
platforms.push({
Expand Down
170 changes: 170 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.