Hi all, I'm having a weird issue where when I navi...
# compose
d
Hi all, I'm having a weird issue where when I navigate, the transition flashes a gray screen. I got the NavHost as bare bones as I can, it's parent is setContent of the Activity.
Copy code
@Composable
@Preview
fun App(
    onUnhideContent: () -> Unit = {},
    //viewModel: AppViewModel = koinViewModel(),
) {
    onUnhideContent()

            NavHost(
                navController = navController,
                startDestination = OnboardingGraph.Onboarding,
                enterTransition = { NavigationTransitions.sharedXAxisEnter(density) },
                exitTransition = { NavigationTransitions.sharedXAxisExit(density) },
                popEnterTransition = { NavigationTransitions.sharedXAxisPopEnter(density) },
                popExitTransition = { NavigationTransitions.sharedXAxisPopExit(density) },
            ) {
                authGraphDestination(
                    navController = navController,
                    onNavigateNext = { }
                )
}
Copy code
setContent {
            App(
                onUnhideContent = { unhideContent = true }
            )
        }
i
Sounds like your transitions have a fade? When both screens are semi-transparent (e.g., in the middle of the transition), you should expect to see the
windowBackground
of your activity through them. That is likely your gray color. You'd want to actually set your window background to be the color you want underneath all your screens, rather than using screens with full backgrounds if you want the background to be present underneath all the screens
d
I see, thank you. Is there a way to get the background to not show, is this to do with my animation timing perhaps (the incoming screen comes in late and so there's nothing to show during that time)? I am trying to somewhat mirror the transition that the Pixel Settings has and there from what I can see the screen fade nicely without an intermission background visible.
i
They just set the background to match their content
d
But there is no point where only the background is visible, which there is in my case. Is that because my transitions are set up with such timing that there is nothing on screen for one moment?