Skip to content

Instantly share code, notes, and snippets.

@fvilarino
Created April 19, 2021 21:36
Show Gist options
  • Save fvilarino/d9d2a13b529b4e29c97fb1965fe8f4d3 to your computer and use it in GitHub Desktop.
Save fvilarino/d9d2a13b529b4e29c97fb1965fe8f4d3 to your computer and use it in GitHub Desktop.
Compose Forecast List
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