nativescript-app-templates
nativescript-app-templates copied to clipboard
chore: Converted `ic_launcher_foreground` vector to png icons
PR Checklist
- [x] The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/CONTRIBUTING.md#commit-messages.
- [x] There is an issue for the bug/feature this PR is for. To avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it.
- [x] You have signed the CLA.
- [ ] All existing tests are passing: https://github.com/NativeScript/NativeScript/blob/master/DevelopmentWorkflow.md#running-unit-tests.
What is the current behavior?
Ever since NS 8 update, launcher icon is defined as a vector drawable sized to 108dp inside ic_launcher_foreground.xml
.
What is the new behavior?
Launcher icon is now called ic_launcher_foreground.png
and is resized to pixels that equal to 108dp for all drawable dpis.
This also makes the use of ns resources generate icons
command possible once more. See https://github.com/NativeScript/nativescript-cli/pull/5667
@CatchABus I don't understand this change. vector drawables are the way to go on newer platforms. you should look at how android studio handles this. it generates both and uses vector drawable when it can
@CatchABus I don't understand this change. vector drawables are the way to go on newer platforms. you should look at how android studio handles this. it generates both and uses vector drawable when it can
It's very simple. This is an adaptation to be compatible with CLI utilities and also keep adaptive icons as a feature. NativeScript has currently no way of generating new icons using this format and that is the main reason of this change.
As a matter of fact
- NativeScript CLI command is trying to generate
icon.png
assets by default and if it fails to find old files, it will skip icon generation. - NativeScript Rocks website will still try to generate old asset icons.
Generating assets through Android Studio might be a good alternative, but many developers who use NativeScript won't even install Android Studio at all and I can understand why.
Combining these changes with https://github.com/NativeScript/nativescript-cli/pull/5667, we can generate icons through CLI once more.
*CLI needs to confirm old assets existence in order to perform asset creation, then it replaces old assets with new assets directly.
These png icons have also been generated in such a way that NS icon along with its old padding is 72dp and the icon as a whole is 108dp.
Even if this is not a desired solution, I want to point out that it's already been a long time since this problem was reported. I believe we need a solution fast as this will give a bad impression to newcomers.