Aditya Thakar
05/21/2021, 9:58 AM@Composable
fun SplashScreen(navController: NavController) {
SplashScreenContent()
val coroutineScope = rememberCoroutineScope()
SideEffect {
coroutineScope.launch {
delay(2000)
navController.popBackStack()
navController.navigate(Screen.Home.route)
}
}
}
patrick
05/21/2021, 10:02 AMSideEffect
by LaunchedEffect(Unit)
Lucien Guimaraes
05/21/2021, 10:03 AM<style name="SplashTheme" parent="@android:style/Theme.Material.Light.NoActionBar">
<item name="android:windowBackground">@drawable/splash</item>
</style>
In your Manifest:
<application
...
android:theme="@style/SplashTheme">
Aditya Thakar
05/21/2021, 10:16 AMAdam Powell
05/21/2021, 1:15 PMColton Idle
05/21/2021, 3:43 PMShakil Karim
05/21/2021, 9:16 PMAditya Thakar
05/22/2021, 8:42 AMandroid:windowSplashScreenAnimatableIcon
as mentioned in the docs - https://developer.android.com/about/versions/12/features/splash-screen