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

Scaling option for Android launcher icons #118

Open
imhoffd opened this issue May 1, 2020 · 12 comments
Open

Scaling option for Android launcher icons #118

imhoffd opened this issue May 1, 2020 · 12 comments
Labels
enhancement New feature or request
Milestone

Comments

@imhoffd
Copy link
Contributor

imhoffd commented May 1, 2020

image

Basically recreate the options under "Scaling" above for devs to provide the same icon as iOS but scale it differently when generating adaptive and legacy icons for Android. Usually, devs will want to use ~66% if they want to use the same icon for iOS and Android.

  • Trim: Yes/No - trims the safe area (--icon-foreground-trim/--icon-background-trim because it's specific for Android icons)
  • Resize: 0-400% - scales the source asset the specified amount (--scale?)
@imhoffd imhoffd added the enhancement New feature or request label May 1, 2020
@imhoffd imhoffd added this to the 1.0.0 milestone May 1, 2020
@mwyld
Copy link

mwyld commented Jun 22, 2020

I'm hitting the same issue as the other guys with the zoomed in icon. Going to do the manual way for the time being but this would be a great addition. +1 from me

@madmacc
Copy link

madmacc commented Feb 20, 2021

Is there any way to stop the app icon in android from being overly zoomed in?
Can't seem to use cordova-res at all for this and have to do it manually.

@wizevlad
Copy link

wizevlad commented May 7, 2021

When will this be released?

@arzyu
Copy link

arzyu commented Jul 20, 2021

Is there any way to stop the app icon in android from being overly zoomed in?
Can't seem to use cordova-res at all for this and have to do it manually.

@madmacc, for the Android adaptive icon, here is my workaround:

Assume I have an original icon resource icon.512x512.png.
Then add transparent padding for it, make sure the new icon size is 512/0.67=764, so my icon stays in a safe area.

@faciliooshell
Copy link

@arzyu thanks for the advice. If people searching for a command line tool, use imagemagick:

convert icon.png -background none -gravity center -extent 1528x1528 icon2.png

@arzyu
Copy link

arzyu commented Aug 6, 2021

Is there any way to stop the app icon in android from being overly zoomed in?
Can't seem to use cordova-res at all for this and have to do it manually.

@madmacc, for the Android adaptive icon, here is my workaround:

Assume I have an original icon resource icon.512x512.png.
Then add transparent padding for it, make sure the new icon size is 512/0.67=764, so my icon stays in a safe area.

Here needs to be corrected, use the icon background color for padding instead of the transparent color

@mlynch mlynch added this to To do in 1.0 via automation Nov 2, 2021
@morsagmon
Copy link

image

Basically recreate the options under "Scaling" above for devs to provide the same icon as iOS but scale it differently when generating adaptive and legacy icons for Android. Usually, devs will want to use ~66% if they want to use the same icon for iOS and Android.

  • Trim: Yes/No - trims the safe area (--icon-foreground-trim/--icon-background-trim because it's specific for Android icons)
  • Resize: 0-400% - scales the source asset the specified amount (--scale?)

Where do I find this configuration dialog box?

@francoisduchemin
Copy link

In Android Studio, right click on "Res" and then click "New" / "Image Asset".

@twoco
Copy link

twoco commented Nov 7, 2022

I don't understand why the icon is scaled. There is no legit reason. The (rounded) icon shapes are always smaller than the source icon. Who had the brilliant idea to zoom the icon? 🤦‍♂️ Adding an option for scaling is not necessary. Just set this option to never scale. Btw. I'm from Cordova and I've never experienced such a problem. Some time ago the Android Icon appearance has been changed. The icon shapes are handled by the Android system. No need for manual rounding etc. At the transition time some legacy icons are rendered smaller with a padding. Is this scaling feature related to this? Weird... why does this not occur with Cordova? I believe there is a configuration for perfect fix. But idk ... I just want to make sure all users see the same icon on any device and OS. I would prefer smaller icons on legacy devices but never crop it. But when I adding a safe padding, the icon appears too small on some devices. Argh... For me scaling down is not really a workaround. It's just a way better than cropped icons. Because the icon is still zoomed in or out on some devices. It reverses the issue. It just looks unprofessional.

@muuvmuuv
Copy link
Contributor

muuvmuuv commented Nov 9, 2022

Same is for iOS imo. Look how all are equal to the source except the higher res once, those are scalled down (padding between "e" and border is higher)...

Bildschirm­foto 2022-11-09 um 09 11 58

@muuvmuuv
Copy link
Contributor

muuvmuuv commented Nov 9, 2022

Ok found out that if you define ios/icon.png and android/icon.png yourself, it will override the ios Icon with the source of the Android icon which in my case has a larger padding specific to this case here. Hmm..

@muuvmuuv
Copy link
Contributor

muuvmuuv commented Nov 9, 2022

Maybe someone has time to test my draft which adds --android-resize that behaves like the Android Studio resize UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
1.0
To do
Development

Successfully merging a pull request may close this issue.

10 participants