Created
October 9, 2023 21:04
-
-
Save ibrahim4851/4a64d9b174be6f80c75af761011d23f9 to your computer and use it in GitHub Desktop.
RecipeTitle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@OptIn(ExperimentalMaterial3Api::class) | |
@Composable | |
fun RecipeTitle(navController: NavController) { | |
var recipeTitle by rememberSaveable { mutableStateOf("") } | |
Surface( | |
modifier = Modifier.fillMaxSize() | |
) | |
{ | |
Scaffold( | |
modifier = Modifier.fillMaxSize(), | |
) { values -> | |
Column(modifier = Modifier | |
.fillMaxSize() | |
.padding(end = 16.dp, bottom = 16.dp)) { | |
Row(modifier = Modifier.fillMaxWidth()) { | |
IconButton(onClick = { navController.currentBackStack }) { | |
Icon( | |
imageVector = Icons.Filled.ArrowBack, | |
contentDescription = null | |
) | |
} | |
} | |
Column( | |
modifier = Modifier | |
.padding(values) | |
.padding(start = 16.dp, end = 8.dp) | |
.weight(1f) | |
) | |
{ | |
Text( | |
text = "What's Your Recipe Title?", | |
fontWeight = FontWeight.Bold, | |
style = Typography.displaySmall | |
) | |
Spacer(modifier = Modifier.padding(8.dp)) | |
Text( | |
text = "Keep the Title Short and Precise", | |
style = Typography.titleLarge | |
) | |
Spacer(modifier = Modifier.padding(8.dp)) | |
TextFieldWithText( | |
"", | |
"e.g. Hamburger", | |
KeyboardType.Text, | |
recipeTitle | |
) | |
} | |
Row( | |
modifier = Modifier | |
.fillMaxWidth() | |
.weight(1f) | |
.padding(start = 8.dp), | |
horizontalArrangement = Arrangement.spacedBy(8.dp), | |
verticalAlignment = Alignment.Bottom | |
){ | |
OutlinedButton( | |
modifier = Modifier.weight(1f), | |
onClick = { } | |
) { | |
Text(text = "Cancel") | |
} | |
Button( | |
onClick = {}, | |
modifier = Modifier.weight(1f) | |
) { | |
Text(text = "Next") | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment