Skip to content

Adaptive icon does not cover default black background #522

Description

@kamilchlebek

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions