Last active
February 5, 2022 14:05
-
-
Save merttoptas/a5ccb680a559d2fff1341179ae4cb8b4 to your computer and use it in GitHub Desktop.
This file contains 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
@Composable | |
fun WelcomeScreen() { | |
Surface(color = MaterialTheme.colors.primary, modifier = Modifier.fillMaxSize()) { | |
WelcomeBackground(modifier = Modifier) | |
Column( | |
modifier = Modifier.fillMaxSize(), | |
horizontalAlignment = Alignment.CenterHorizontally, | |
) { | |
WelcomeLeafImageBackground(modifier = Modifier | |
.offset(x = 88.dp) | |
.padding(top = 72.dp) | |
) | |
Spacer(modifier = Modifier.height(48.dp)) | |
BloomLogo() | |
BloomText(modifier = Modifier) | |
CreateAccountButton(modifier = Modifier) | |
Spacer(modifier = Modifier.height(8.dp)) | |
LogInTextButton(modifier = Modifier) | |
} | |
} | |
} | |
@Composable | |
fun WelcomeBackground(modifier: Modifier) { | |
Image( | |
modifier = modifier.fillMaxWidth(), | |
painter = painterResource(id = R.drawable.ic_light_welcome_bg), | |
contentDescription = null, | |
contentScale = ContentScale.FillBounds, | |
) | |
} | |
@Composable | |
fun WelcomeLeafImageBackground(modifier: Modifier) { | |
Image( | |
modifier = modifier | |
.fillMaxWidth(), | |
painter = painterResource(id = R.drawable.ic_light_welcome_illos), | |
contentDescription = null, | |
contentScale = ContentScale.Inside, | |
) | |
} | |
@Composable | |
fun BloomLogo() { | |
Image( | |
painter = painterResource(id = R.drawable.ic_light_logo), | |
contentDescription = null, | |
contentScale = ContentScale.Fit, | |
) | |
} | |
@Composable | |
fun BloomText(modifier: Modifier) { | |
Text( | |
modifier = modifier.paddingFromBaseline(top = 32.dp, bottom = 40.dp), | |
text = "Beautiful home garden solutions", | |
color = MaterialTheme.colors.onBackground, | |
style = MaterialTheme.typography.subtitle1 | |
) | |
} | |
@Composable | |
fun LogInTextButton(modifier: Modifier) { | |
TextButton( | |
onClick = {}, | |
modifier = modifier | |
.padding(horizontal = 32.dp) | |
.defaultMinSize(minHeight = 50.dp), | |
content = { | |
Text(text = "Log in", color = MaterialTheme.colors.secondary) | |
} | |
) | |
} | |
@Composable | |
fun CreateAccountButton(modifier: Modifier) { | |
Button( | |
onClick = { /*TODO*/ }, | |
shape = RoundedCornerShape(50), | |
modifier = modifier | |
.fillMaxWidth() | |
.padding(horizontal = 16.dp), | |
colors = ButtonDefaults.buttonColors(backgroundColor = MaterialTheme.colors.onPrimary), | |
) { | |
Text(text = "Create Account", color = Color.White) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment