15

I use the new splashscreen api to add an evenly splashscreen to all android versions down to API Level 23. Are there any requirements for the splash icon? Currently i try to use a svg and i thought it would be sized automatically on different screens. Does anyone experienced this aswell and has a workaround or knows those (hidden?) requirements?

I use the latest splashscreen api version (1.0.0-alpha02) and this is my theme:

    <style name="SplashTheme" parent="Theme.SplashScreen">
        <item name="windowSplashScreenBackground">@color/colorPrimary</item>
        <item name="windowSplashScreenAnimatedIcon">@drawable/ic_disney_wordmark</item>
        <item name="postSplashScreenTheme">@style/AppTheme</item>
        <item name="windowSplashScreenAnimationDuration">1000</item>
    </style> 

This is the ouput with the ic_disney_wordmark as example which is an svg: enter image description here

Thanks for your help!

Lars
  • 794
  • 7
  • 21

3 Answers3

9

You must now size your icon layers using the following guidelines:

  • Both layers must be sized at 108 x 108 dp.
  • The inner 72 x 72 dp of the icon appears within the masked viewport.
  • The system reserves the outer 18 dp on each of the 4 sides to create interesting visual effects, such as parallax or pulsing.

Note:

  • As with adaptive icons, one-third of the foreground is masked (3).
  • The app icon (1) should be a vector drawable, and it can be static or animated. enter image description here

Source : Android Apaptive Icons , Android Splash Screen

Nitish
  • 3,075
  • 3
  • 13
  • 28
7

Do what I did, create an icon as an image in Android Studio, a right-click on drawable then new/image asset, choose a source from your SVG, and then resize it to fit the circle (be visible), and that is all. Then point to the foreground part of the created file in your splash configuration.

Nenad Štrbić
  • 367
  • 4
  • 6
  • 1
    Thanks, your answer helped me get the logo fit inside the circle. Using a vector asset directly was cropping the image even when it was of right dimensions. – hamrosvet Sep 14 '22 at 16:17
  • 2
    @hamrosvet Noting I did would work either. No matter what size it would still crop it even using vector. Google and their asine apis just make things more difficult for devs when that should be super easy. – Panama Jack Jan 11 '23 at 23:19
0

You can also manually scale your SVG.

<vector>
<group
      android:scaleY="0.5"
      android:scaleX="0.5">
.
.
.
</group>
</vector>

PS: you also need to centre the icon using the "pivotX" and "pivotY"

Abdelkader
  • 96
  • 5