Skip to content

Recipe home screen#2

Open
shadyashraf174 wants to merge 5 commits intomasterfrom
RecipeHomeScreen
Open

Recipe home screen#2
shadyashraf174 wants to merge 5 commits intomasterfrom
RecipeHomeScreen

Conversation

@shadyashraf174
Copy link
Owner

add a new home screen and fix the problems

Screenshot 2024-04-23 091351

@AmrAbuelhamd
Copy link
Collaborator

remove both caramelized_french.png, and meat_loaf.png
you don't use them also you shouldn't use cornered images because backend will not send cornered images.

@AmrAbuelhamd AmrAbuelhamd self-requested a review April 24, 2024 07:16
color = MaterialTheme.colorScheme.background
) {
Greeting("Android")
ComposeNavigation()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

normally this called AppNameNavigation -> RecipeNavigation


@Preview(showBackground = true)
@Composable
fun GreetingPreview() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not GreetingPreview but RecipeNavigationPreview()

NavHost(navController = navController, startDestination = "S_1") {
composable("S_1") {
RecipeHomeScreen()
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

S_1 -> RecipeHomeScreen

}
composable("S_2") {
RecipeDetails(navController)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check comment above

RecipeHomeScreen()
}
composable("S_2") {
RecipeDetails(navController)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. RecipeDetails -> RecipeDetailsScreen
  2. do not send navController: encaspsulate all nav logic inside navigation file -> ComposableFunction(){paramsIfAny-> navController.navigate(....)}

@@ -0,0 +1,24 @@
package com.example.recipe
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code is not formatted, never push code that is not formatted please


@Composable
fun RecipeHomeScreen(names: List<String> = List(1000) { "$it" }) {
val navController = rememberNavController()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code is not formatted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants