Reputation: 45
I would like to use a decent size rectangle shape icon in android 12 splash screen, even though the icon I use is rectangle shape it is always displayed in a circle shape. I saw one question / answer here, How to change icon shape in Android 12 Splash screen? If I follow the answer from here, the icon is rectangle but it is small?
Like, this netflix is good size one (which is from android 12 phone), and I would like to make a similar one.
Upvotes: 0
Views: 1865
Reputation: 45
I read the documentation carefully, and it cannot use wider space! It stated
For example, if the full size of an image is 300×300 dp, the icon needs to fit within a circle with a diameter of 200 dp. Everything outside the circle will be invisible (masked).
https://developer.android.com/guide/topics/ui/splash-screen#splash_screen_dimensions
I was using an icon with background originally, so I was able to use only 160dp, however, once change the icon to be without background, I can use 192dp(or 200dp?) as the documentation, which is enough space for us.
I had to modify my image size by adding in our svg file to fit in the circle.
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="1920dp"
android:height="492dp"
android:viewportWidth="1920"
android:viewportHeight="492">
<group
android:pivotX="960"
android:pivotY="246"
android:scaleX="0.65"
android:scaleY="0.17">
<path .../>
<path .../>
</group>
</vector>
Upvotes: 2