ionic-team / ionic-team/capacitor-assets

Adaptive icon does not cover default black background

Open
#522 11 comments 18 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
583
Forks
116
PR merge metrics
No merged PRs in 30d

Description

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 https://github.com/ionic-team/capacitor-assets/pull/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](https://github.com/ionic-team/capacitor-assets/assets/40219331/cd0dbdb3-818b-4425-a0cc-75cd9a1d1624)

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.