Speaking of 12 Splash Screen, What is Splash Screen? Splash Screen can be defined as a graphic control component consisting of a new space covering an image, a logo, and the current version of the software. After the load is complete, the user is generally taken to another more functional screen.
The splash screen is generally just a display screen to orient users and gives them something to look at while the hardware is working to present the software to them.
12 Splash Screen
12 Splash screen on Android is a lunch animation that covers the full display of your phone for a split second till the app loads. Google Drive is the first Google app to support a splash screen on Android.
In Android 12, there are new splash screen APIs. The screen will be a very similar smooth experience that we saw from the attribute added in API 26 except this time out of the box.
Splash screen in android
Android Splash Screen is the first screen visible to users when the applications were launched. the splash screen that appears when you open an app on your mobile devices.
Android 12 adds the Splash Screen API, which enables a new app launch animation for all apps when running on a device with Android 12 or higher.
This includes an into-app motion at launch, a splash screen showing your app icon, and a transition to your app itself.
Android 12 Splash Screen
The Android 12 developer preview contains support for splash screens. Today we will explore Splash screen API which is introduced in Android 12.
To make app startup a more consistent and delightful experience android team added a new app launch animation for all apps from the point of launch. It shows the app icon, branding icon (optional), and a transition to the app itself.
How to migrate splash screen to Android 12
The following are ways to migrate the splash screen to android 12.
- In the build. Gradle file, change your compile version, and include the splash screen comp at a library in dependencies.
- After that, create a theme with a parent of Theme. splash screen, and set the values of ‘post Splash Screen Theme’ to the theme that the ‘Activity’ should use
- Use window splash screen Animated Icon to a drawable or animated drawable. The other attributes are optional.
- After that, in the manifest, replace the theme of the starting activity with the theme you created in the previous step
- Lastly, call install splash screen in the starting activity before calling set Content View
‘Install Splash Screen’ returns the splash screen object, which you can optionally use to modify animation or keep the splash screen on screen for a longer duration.
For more details on customizing the animation, see Keep the splash screen on-screen for longer periods and customize the animation for dismissing the splash screen.
Features to set a theme for the Splash Screen
- Use window-Splash-Screen-Background to fill the background with a single color
- If you want to use animated drawable, then use Animation-Drawable or Animated-Vector-Drawable
- Use the window-splash-screen-animation-duration to set the duration of the splash screen icon animation
- To set a Background behind the splash screen icon, use the window-splash-screen background color.
- To show an image at the bottom of the splash screen use a window-splash-screen-branding image. This only supports Android 12+. It shows have 200dp width and 80dp height. It should be in a rectangular aspect ratio.
- And, don’t forget to add configuration for the status bar and navigation bar to make sure you have a consistent theme applied when launching the app
- Now, in the manifest, replace the base theme with the custom theme you created for the splash screen.
- Call INSTALLSPLASHSCREEN in the launcher activity before calling set content view.
How to implement Splash Screen in Android app
- They should use vector drawable for an app icon (1). The app icon can be either be static or animated and the animation may have unlimited time, nevertheless, it should not exceed 1000 milliseconds. By default, the launcher icon is used.
- The icon background (2) is optional and it is useful if more contrast is needed between the icon and the window background.
- As with adaptive icons, ⅓ of the foreground is masked (3).
- The window background (4) consists of a single opaque color.
Note that the splash screen animation procedure consists of entering and exit animations.
To know more about Splash Screen visit https://developer.android.com
Thanks for reading