Nat Strangerweather
12/04/2022, 5:41 PMNat Strangerweather
12/04/2022, 5:43 PM@Composable
fun Navigation() {
val navController = rememberNavController()
NavHost(navController = navController, startDestination = Screen.MainScreen.route) {
composable(route = Screen.MainScreen.route) {
MainApp(navController = navController)
}
composable(
route = Screen.DescriptionScreen.route + "/{description}/{pubDate}",
arguments = listOf(
navArgument("description") {
type = NavType.StringType
defaultValue = ""
nullable = true
},
navArgument("pubDate") {
type = NavType.StringType
defaultValue = ""
nullable = true
}
)
) { entry ->
DescriptionScreen(
entry.arguments?.getString("description"),
entry.arguments?.getString("pubDate"),
navController
)
}
}
}
Here is the rest of the code:
sealed class Screen (val route: String){
object MainScreen: Screen("main_screen")
object DescriptionScreen: Screen("description_screen")
fun withArgs(vararg args: String): String{
return buildString {
append(route)
args.forEach {arg ->
append("/$arg")
}
}
}
}
Nat Strangerweather
12/04/2022, 5:45 PMNavigation destination that matches request NavDeepLinkRequest{ uri=<android-app://androidx.navigation/description_screen/><p>Exclusive: Dave Lewis, chair of the startup hoping to provide 8% of Britain's energy, talks about net zero frustrations</p><p>An £18bn project to connect Britain with a huge wind and solar farm in the Sahara through an undersea cable has been delayed by at least a year because of political ructions in Westminster.</p><p>The energy startup Xlinks hopes to provide 8% of Britain's energy supplies through a 3,800km (2,360-mile) cable linking Morocco with the UK, powering 7m homes by 2030.</p> <a href="<https://www.theguardian.com/business/2022/dec/04/government-chaos-delays-uk-sahara-energy-link>">Continue reading...</a>/Sun, 04 Dec 2022 16:31:29 GMT } cannot be found in the navigation graph NavGraph(0x0) startDestination={Destination(0x26775c05) route=main_screen}
yschimke
12/04/2022, 5:47 PMyschimke
12/04/2022, 5:47 PMyschimke
12/04/2022, 5:48 PMNat Strangerweather
12/04/2022, 5:49 PMNat Strangerweather
12/04/2022, 5:50 PMNat Strangerweather
12/04/2022, 5:50 PMyschimke
12/04/2022, 5:52 PMNat Strangerweather
12/04/2022, 5:53 PMyschimke
12/04/2022, 5:53 PMNat Strangerweather
12/04/2022, 5:53 PMyschimke
12/04/2022, 5:54 PMNat Strangerweather
12/04/2022, 5:55 PMyschimke
12/04/2022, 6:00 PMfun withArgs(vararg args: String): String{
return buildString {
append(route)
args.forEach {arg ->
append("/$arg")
}
}
}
Nat Strangerweather
12/04/2022, 6:03 PMNavigation destination that matches request NavDeepLinkRequest{ uri=<android-app://androidx.navigation/description_screenxxxxxx> } cannot be found in the navigation graph NavGraph(0x0) startDestination={Destination(0x26775c05) route=main_screen}
yschimke
12/04/2022, 6:04 PMyschimke
12/04/2022, 6:04 PMNat Strangerweather
12/04/2022, 6:04 PMNat Strangerweather
12/04/2022, 6:05 PMyschimke
12/04/2022, 6:06 PMyschimke
12/04/2022, 6:07 PMNat Strangerweather
12/04/2022, 6:08 PMyschimke
12/04/2022, 6:08 PMNat Strangerweather
12/04/2022, 6:09 PMyschimke
12/04/2022, 6:10 PMNat Strangerweather
12/04/2022, 6:10 PMyschimke
12/04/2022, 6:10 PMyschimke
12/04/2022, 6:10 PMNat Strangerweather
12/04/2022, 6:10 PM