Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

compose NavHost Start the white Screen

My app starts with navigation globally, but I found that when I set the following code, the app will remain blank after startup unless I manually touch the screen.

rememberSystemUiController().setStatusBarColor(
 Color.Transparent,
 darkIcons = true //This sentence must be set
)
fun AppNavigation(
    appNavController:NavHostController = LocalAppNavController.current
) {
    NavHost(
        navController = appNavController,
        startDestination = Screen.Splash.route
    ) {
        composable(route = Screen.Splash.route) {
            SplashScreen()
        }
        composable(route = Screen.HelloScreen.route) {
            HelloScreen()
        }
        composable(route = Screen.HomeScreen.route) {
            val popItem = remember{
                mutableStateOf(NULL_MEDIA_ITEM)
            }
            CompositionLocalProvider(
                LocalHomeNavController provides rememberNavController(),
                LocalNetViewModel provides hiltViewModel(),
                LocalUserViewModel provides hiltViewModel(),
                LocalHomeViewModel provides hiltViewModel(),
                LocalPopWindowItem provides popItem
            ){
                LocalUserViewModel.current.initializeController()
                HomeScreen()
            }
        }
    }

}
like image 530
花未开 Avatar asked Dec 16 '25 13:12

花未开


1 Answers

It seems like a known issue: https://issuetracker.google.com/issues/227926002

As of comments - different Xiaomi models affected. My POCO one affected too.

like image 59
uptoyou Avatar answered Dec 19 '25 06:12

uptoyou



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!