Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Converted ic_launcher_foreground vector to png icons #210

Closed

Conversation

CatchABus
Copy link
Contributor

@CatchABus CatchABus commented May 3, 2022

PR Checklist

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 NativeScript/nativescript-cli#5667

@farfromrefug
Copy link

@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
Copy link
Contributor Author

CatchABus commented May 4, 2022

@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 NativeScript/nativescript-cli#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants