Splash icon in android 12 is truncated

Viewed 116

I am developing a splash screen using the library androidx.core:core-splashscreen.

As shown in the official documentation, the icon size of windowSplashScreenAnimatedIcon is set to 288x192, but when the app is run on an api level 31 or higher device, the icon appears to be truncated.

Is there any way to solve this?

[google splash guide] enter image description here

[My themes.xml]

<style name="AppTheme.Splash" parent="Theme.SplashScreen">
    <item name="windowSplashScreenBackground">@color/color_aeaeae</item>
    <item name="windowSplashScreenAnimatedIcon">@drawable/splash_icon</item>
    <item name="postSplashScreenTheme">@style/AppTheme.NoActionBar</item>
</style>

[My splash_icon.xml]

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

    <item
        android:width="288dp"
        android:height="288dp"
        android:drawable="@android:color/transparent"
        android:gravity="center" />

    <item
        android:width="192dp"
        android:height="192dp"
        android:drawable="@drawable/ic_baseline_sick"
        android:gravity="center" />

[Screenshot] enter image description here

위의 스크린샷에서 가운데 아이콘은 원래 이런 모양입니다. enter image description here

0 Answers
Related