Android 12 Splash Screen API

Updated 13 December 2023

Save

Android 12 introduces the SplashScreen API which enables a new app launch animation.

Implementation in Android app

We should follow the below points at the time of implementing SplashScreen:-

  1. We should use vector drawable for app icon(1). The app icon can either static or animated and the animation may have unlimited time, however it should not exceed 1000 miliseconds. By default, the launcher icon is used.
  2. The icon background (2) is optional and it is useful if more contrast is needed between the icon and the window background.
  3. As with adaptive icons, ⅓ of the foreground is masked (3).
  4. The window background (4) consists of a single opaque color.

Note:- The splash screen animation mechanics consist of entering and exit animations.

Enter animation
The enter animation contains the android OS view to the splash screen. The android OS control it and is not customizable.

Exit animation
The exit animation contains the animation run that hides the splash screen. If we want to customize it, we should have access to SplashScreenView.

More about SplashScreenView:-

Customize the splash screen

For customizing the SplashScreen

Set a theme for the splash screen to change its appearance

If we are already using attributes like android:windowBackground, then subsequently we can also use an alternate resource file for Android 12.

Keep the splash screen on-screen for longer periods

When the app draws the first frame, the splashscreen will disappear. If we need to load a small amount of data from a local disk asynchronously, we can use ViewTreeObserver.OnPreDrawListener to suspend the app to draw its first frame.

Customize the animation for dismissing the splash screen

Please go through the below links to get more details on Android 12 SplashScreen API:-

author
. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Start a Project


    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home