Developing Apps with Jetpack Compose for Android【03】 - Compose Navigation
Having had the opportunity to develop an entire project using Compose
After some exploration
I have some insights to share
I decided to write this process into notes to share with everyone
So today we will implement NavHost in Compose
It will contain the content you expect to navigate to
It can be expanded gradually as needed
Extend NavGraphBuilder to specify the router for each screen
Here, we use the previously defined Login
as a reference indicator for its router
To navigate to the LoginScreen, add the screen in the lambda
startDestination
: your starting screen
navController
: used to specify the navigation controller
To switch screens, simply control it with navController
For example: navController.navigate(ElegantAccessScreen.Feedback.name)
Simply implement the Screen

Practical use: