Conversation
|
remove both caramelized_french.png, and meat_loaf.png |
| color = MaterialTheme.colorScheme.background | ||
| ) { | ||
| Greeting("Android") | ||
| ComposeNavigation() |
There was a problem hiding this comment.
normally this called AppNameNavigation -> RecipeNavigation
|
|
||
| @Preview(showBackground = true) | ||
| @Composable | ||
| fun GreetingPreview() { |
There was a problem hiding this comment.
this is not GreetingPreview but RecipeNavigationPreview()
| NavHost(navController = navController, startDestination = "S_1") { | ||
| composable("S_1") { | ||
| RecipeHomeScreen() | ||
| } |
There was a problem hiding this comment.
S_1 -> RecipeHomeScreen
| } | ||
| composable("S_2") { | ||
| RecipeDetails(navController) | ||
| } |
| RecipeHomeScreen() | ||
| } | ||
| composable("S_2") { | ||
| RecipeDetails(navController) |
There was a problem hiding this comment.
- RecipeDetails -> RecipeDetailsScreen
- do not send navController: encaspsulate all nav logic inside navigation file ->
ComposableFunction(){paramsIfAny-> navController.navigate(....)}
| @@ -0,0 +1,24 @@ | |||
| package com.example.recipe | |||
There was a problem hiding this comment.
file name should be equal to the method inside it -> RecipeNavigation.kt
| .padding(start = 16.dp), | ||
| colors = CardDefaults.cardColors(containerColor = Color.Transparent), | ||
| shape = RoundedCornerShape(0), | ||
| onClick = {navHostController.navigate("S_2")} |
There was a problem hiding this comment.
code is not formatted, never push code that is not formatted please
|
|
||
| @Composable | ||
| fun RecipeHomeScreen(names: List<String> = List(1000) { "$it" }) { | ||
| val navController = rememberNavController() |
There was a problem hiding this comment.
mistake, you call rememberNavController only once in the app, also don't call navigation outside navigation file.
| start = 8.dp, | ||
| top = 11.dp, | ||
| end = 8.dp, | ||
| bottom = 6.dp), |
There was a problem hiding this comment.
code is not formatted
add a new home screen and fix the problems