Created
April 19, 2021 21:23
-
-
Save fvilarino/5a30760b6d78427d714ce2a36ed6490e to your computer and use it in GitHub Desktop.
Compose Forecast Header
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
fun ForecastHeader( | |
state: ForecastItem.ForecastHeader, | |
modifier: Modifier = Modifier, | |
) { | |
Column( | |
modifier = modifier, | |
horizontalAlignment = Alignment.CenterHorizontally, | |
) { | |
Text( | |
text = state.date, | |
style = MaterialTheme.typography.h6, | |
) | |
Row(horizontalArrangement = Arrangement.SpaceEvenly) { | |
Text( | |
text = stringResource(id = R.string.sunrise_label), | |
style = MaterialTheme.typography.overline, | |
modifier = Modifier.alignByBaseline(), | |
) | |
Spacer(modifier = Modifier.width(MarginSingle)) | |
Text( | |
text = state.sunrise, | |
style = MaterialTheme.typography.caption, | |
modifier = Modifier.alignByBaseline(), | |
) | |
Spacer(modifier = Modifier.width(MarginDouble)) | |
Text( | |
text = stringResource(id = R.string.sunset_label), | |
style = MaterialTheme.typography.overline, | |
modifier = Modifier.alignByBaseline(), | |
) | |
Spacer(modifier = Modifier.width(MarginSingle)) | |
Text( | |
text = state.sunset, | |
style = MaterialTheme.typography.caption, | |
modifier = Modifier.alignByBaseline(), | |
) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment