Android, how to make Splash Screen aka Launch Screen without a white screen?

Like many other Android developers, I am not a big fan of splash screens, but still most customers want them because the iPhone has them or some other “great” reason.

Android manual states:

Naturally, you want everyone to quickly learn the ropes, discover interesting functions and get the most out of your application. Thus, you may be tempted to present a one-time introductory slideshow, video, or pop-up window to all new users when you first open the application. Or you can pay attention to the idea of ​​displaying useful text bubbles or dialogs when users first interact with certain functions.

Link here , first paragraph in "Do not show unsolicited help, except in very limited cases"

And now, in material design guides, they recommend developers use the "Launch Screen"

Since launching your application while displaying a blank canvas increases the load perception time, consider using a placeholder UI or a proprietary launch screen.

I assume that the Android site is not updated. In any case, the latest version of Hangouts (5.0.104 ...) has a very nice and fast launch screen. It instantly displays on my Nexus 5 with Marshmallow. So my question is, is there an “official” way to do this?

I searched for examples, but can't find anything but those workarounds, like this example here , which uses what I consider the most common approach with Screen Saver. This, however, shows a white screen when the application was destroyed before the actual splash screen was displayed.

This second example uses a theme with a window background that displays instantly but disappears almost equally quickly.

So, how does Google make the launch screen, like in Google Hangouts, which is displayed without delay and without any white screen before?

+5
source share
2 answers

An employee of my work was trained in material design at Google headquarters in London, and their official way of doing this is using the windowBackground in the subject when you posted on your own question: http://antonioleiva.com/branded-launch-screen/

The idea is that the XML theme manifests itself very quickly in the structure, and as soon as your actual layout is loaded, it will be visible.

The difference between Hangouts and even Google Maps is that their layout is very complex and complex, and they just take longer than the HelloWorld application.

As your application grows and becomes more complex, and when you initialize more elements during Application.onCreate or Activity.onCreate , your slash will also be displayed for a longer time.

change

I found a post on Google+ from the official Android Developers profile and a report from Google engineer Jan Lake saying the same thing:

https://plus.google.com/+AndroidDevelopers/posts/Z1Wwainpjhd https://plus.google.com/+IanLake/posts/SW7F2CJvAmU

+12
source

This is because the first solution ( http://antonioleiva.com/branded-launch-screen/ ) changes the theme in onCreate. But the widgets of your activity are not yet displayed in onCreate . That is why you see a white screen. The second example is a good one. If you need more time, set SPLASH_TIME longer. Check the Thread.sleep line (SPLASH_TIME) in the doInBackground function. You can wait more.

0
source

Source: https://habr.com/ru/post/1234142/


All Articles