I know about the way to get rid of the "white screen" in Android applications. Who does not know, this can be found in this article . So, where and how to create a good picture that supports all kinds of screens for splash screen? Since we are limited to only drawable , the maximum way we can write a replacement for XML is to use layer-list .

In general, this is behind the scenes, the question is this: in all Google applications, the same type of splash is shown: the icon in the center and the name of the application (in the same font and color, just above the bottom of the screen. It was interesting what kind of software / website uses Google ? Can anyone know?

Splash:

https://i.stack.imgur.com/RLdST.png

https://img.talkandroid.com/uploads/2015/06/2015-06-29-22.10.29.png

UPD

Not only in Google applications :) This is definitely something already ready and everyone uses it. Share who knows

  • Can you not insert mutated photos into the questions? reduce them at least by half or two thirds - Alexey Shimansky
  • Google do the same as everyone else. how to make drawable for all screens - here spleshes have the same solution as other activites. Daddy doing under all permissions. splashes (activites) you can set the topic. google all their activites ask one style - Sviat Volkov
  • android has long supported vector mode for graphics ... - mit
  • @mit, it changes nothing. problem with zoo screen resolution remains - Flippy
  • @Flippy you are wondering where to get a good picture that supports all sorts of screens for splash screen. I suggest that you use vector format instead of raster. The vector scales automatically under the screen. Cutting at the same time - not needed. Or I misunderstood your question ... Currently, I see no reason at all to use raster in applications, unless some kind of ancient OS version is supported. - mit

1 answer 1

1) Create a drawable/launch_screen.xml ( drawable/ic_app_logo.png is a bitmap image, a vector image is drawn only at the very end of the application download):

 <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:opacity="opaque"> <!-- The background color, preferably the same as your normal theme --> <item android:drawable="@android:color/white"/> <!-- Your product logo - 144dp color version of your app icon --> <item> <bitmap android:src="@drawable/ic_app_logo" android:gravity="center"/> </item> </layer-list> 

2) add a new topic:

 <style name="AppTheme.Launcher"> <item name="android:windowBackground">@drawable/launch_screen</item> </style> 

3) put this topic to activate in AndroidManifest.xml :

 <activity android:name=".ui.MainActivity" android:label="@string/app_name" android:theme="@style/AppTheme.Launcher"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> 

4) change the theme to the usual one for your application (not necessarily AppTheme.NoActionBar ) before calling super.onCreate()

 public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { setTheme(R.style.AppTheme_NoActionBar); super.onCreate(savedInstanceState); ... } } 

About the size of the icons:

 mdpi @ 144.00dp = 144.00px hdpi @ 144.00dp = 216.00px xhdpi @ 144.00dp = 288.00px xxhdpi @ 144.00dp = 432.00px xxxhdpi @ 144.00dp = 576.00px 
  • Google recommends 144dp - respectively, for each density you need your own icon - DeKaNszn
  • Not understood. How do I measure 144dp on the icon?) - Flippy
  • Added the size of the icons in response - DeKaNszn