Android 12 Splash Screen API

Save

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

Android 12 Splash Screen API

Implementation in android app

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

https://developer.android.com/about/versions/12/images/splash-screen-composition.png
  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:-
https://developer.android.com/reference/android/window/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 for getting more detail on Android 12 SplashScreen API:-

https://developer.android.com/about/versions/12/features/splash-screen
https://developer.android.com/reference/android/window/SplashScreen
https://developer.android.com/reference/android/window/SplashScreenView

. . .

Leave a Comment

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


Be the first to comment.

css.php

We've bought a Shopware Extension which is a hybrid App, which we can now offer in the Google Play Store and the IOS App Store. I'am still impressed how fast and how sharp the support team leads us through every process of the App-Store clarification. Very fast and useful response.

Markus Walter

Markus Walter

Founder, Das Apartment Living

Talk to Sales

Global

Live Chat
Start a Project


    Message Sent!

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

    Back to Home