Demo android API 31 splash screen with Nativescript
Android 12 introduces a new splashscreen paradigm, which is detailed here.
A good writeup on this an a step by step guide is given here.
This repo contains an app created from the Hello World
angular template, updated to use the alpha
version of @nativesript\android
and built with the next
version of the NS cli. ( i.e. pre 8.2 versions).
The original splash screen is shown for API<31 phones and the new type of splash screen for API>=31 phones.
( Well it works on the emulators anyway).
Note: I don't see the splash screen on API 31 emulator when I do ns run android
but if you relaunch the app on the emulator you see it.
Change @nativescript/android
version to alpha
Change to sdk 31 and add splashscreen dependency.
New white color
- Change the LaunchScreenThemeBase parent to the Splash screen style
- Add transparent colors for the new splash screen elements ( so that the old splash screen will show )
App_Resources/Android/src/main/res/values-v31/styles.xml
Set the new splash screen properties to point to an animated imageApp_Resources/Android/src/main/res/drawable-nodpi/ns_anim.xml
The animated image to show on the new splash screen.