Created
April 19, 2021 21:36
-
-
Save fvilarino/d9d2a13b529b4e29c97fb1965fe8f4d3 to your computer and use it in GitHub Desktop.
Compose Forecast List
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
LazyColumn( | |
modifier = Modifier.fillMaxWidth().padding(bottom = MarginSingle), | |
verticalArrangement = Arrangement.spacedBy(MarginSingle), | |
horizontalAlignment = Alignment.CenterHorizontally | |
) { | |
items(state.forecastItems) { item -> | |
when (item) { | |
is ForecastItem.ForecastHeader -> ForecastHeader( | |
state = item, | |
modifier = Modifier.fillMaxWidth(.85f), | |
) | |
is ForecastItem.ForecastCard -> ForecastWeatherCard( | |
state = item, | |
modifier = Modifier | |
.fillMaxWidth(.85f) | |
.padding(horizontal = MarginSingle), | |
) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment