In my project I'm using:
implementation "androidx.hilt:hilt-navigation-compose:1.1.0-alpha01"
Inside onCreate()
I use:
setContent {
val navController = rememberNavController()
NavGraph(
navController = navController
)
}
And here is my very simple NavGraph:
fun NavGraph(
navController: NavHostController
) {
NavHost(
navController = navController,
startDestination = "SignIn"
) {
composable(
route = "SignIn"
) {
SignInScreen(
onNavigateToForgotPasswordScreen = {
navController.navigate(Screen.ForgotPasswordScreen.route)
}
)
}
composable(
route = "ForgotPassword"
) {
ForgotPasswordScreen()
}
}
}
The problem comes when I try to navigate from SignInScreen
to ForgotPasswordScreen
. When I do that, the TopAppBar starts flashing / flickering. Somehow there is an animation, a crossfade that I don't want. How can I stop this from happening?
What I have tried, is to use Accompanist library, but according this the docs, it will be deprecated. I've searched all answers here and none was helping. How to solve this without Accompanist?
P.S.
Here is how a screen is represented:
fun SignInScreen {
Scaffold(
topBar = {
SignInTopBar()
},
content = { padding ->
SignInContent(
padding = padding,
)
}
)