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

Adaptive icon does not cover default black background #522

Open
kamilchlebek opened this issue May 17, 2023 · 8 comments
Open

Adaptive icon does not cover default black background #522

kamilchlebek opened this issue May 17, 2023 · 8 comments

Comments

@kamilchlebek
Copy link

I noticed small issue when trying to setup splash screen on Android >= 12.

Namely there's a little bit of black color on the edges of the icon.

The issue is related with #424 which added android:inset="16.7%" to the foreground & background.
I suppose that due to calculation inaccuracy (1/6 ≈ 16.7%), the background is too small and doesn't cover default background that lies underneath.

Workaround

Change: android:inset="16.7%" to android:inset="16.6%"

Actual (left), Expected (right)

splash

Here's a StackOverflow thread that describes how are icons rendered:

https://stackoverflow.com/a/49869048/9932919

It links to android source that explains where does that black color come from:

https://android.googlesource.com/platform/frameworks/base/+/oreo-release/graphics/java/android/graphics/drawable/AdaptiveIconDrawable.java#351

@Dante1349
Copy link

we have the same issue, generated icons for android are useless

@MunizErthal
Copy link

Same here...

@killingHail606
Copy link

Same :)

@fernao
Copy link

fernao commented Sep 28, 2023

Same here!

@fernao
Copy link

fernao commented Sep 28, 2023

I didn't get the workaround, the inset... I'm using capacitor and I'm experiencing the 1px black line at right and botton of icon.
I would like to know how should I update my AndroidManifest.xml with:
android:inset="16.6%"

@fernao
Copy link

fernao commented Sep 29, 2023

I did the workaround, but have to manually edit while capacitor-assets is not fixed.
I've found the android:inset in those two files in a search with grep:

grep -r 'android:inset' android/app/src/main/res

android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:        <inset android:drawable="@mipmap/ic_launcher_background" android:inset="16.7%" />
android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:        <inset android:drawable="@mipmap/ic_launcher_foreground" android:inset="16.7%" />
android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:        <inset android:drawable="@mipmap/ic_launcher_background" android:inset="16.7%" />
android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:        <inset android:drawable="@mipmap/ic_launcher_foreground" android:inset="16.7%" />

So, after the changes to 16.6% it worked!

@funkenstrahlen
Copy link

I did the workaround, but have to manually edit while capacitor-assets is not fixed. I've found the android:inset in those two files in a search with grep:

grep -r 'android:inset' android/app/src/main/res

android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:        <inset android:drawable="@mipmap/ic_launcher_background" android:inset="16.7%" />
android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:        <inset android:drawable="@mipmap/ic_launcher_foreground" android:inset="16.7%" />
android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:        <inset android:drawable="@mipmap/ic_launcher_background" android:inset="16.7%" />
android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:        <inset android:drawable="@mipmap/ic_launcher_foreground" android:inset="16.7%" />

So, after the changes to 16.6% it worked!

This worked for me!

@lil5
Copy link

lil5 commented Jun 24, 2024

PR #534 will fix this, where are you ionic devs?

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

No branches or pull requests

7 participants