I am using theme instead of layout to show splash screen,but I am confused what resolution images to set for different screen densities,because <item>
tag's width and height attributes available API>22.
Background drawable
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/colorAccent" />
<item >
<bitmap
android:gravity="center"
android:src="@drawable/splash_logo" />
</item>
</layer-list>
Style
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/splash_background</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorPrimary">@color/colorPrimary</item>
</style>
Splash Image size for different resolution devices for portrait
MDPI = 320x480px
LDPI = 240x360px
HDPI = 480x720px
XHDPI = 640x960px
XXHDPI = 960x1440px
XXXHDPI = 1280x1920px
From https://romannurik.github.io/AndroidAssetStudio/index.html you can make a 9-patch image for all the resolutions - XHDPI,HDPI,MDPI,LDPI
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With