You can no longer go back in time
This commit is contained in:
parent
841447cdc9
commit
43b7b42495
1 changed files with 5 additions and 7 deletions
|
@ -3,7 +3,6 @@ package com.henryhiles.qweather.presentation.components.weather
|
|||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.lazy.LazyRow
|
||||
import androidx.compose.foundation.lazy.itemsIndexed
|
||||
import androidx.compose.foundation.lazy.rememberLazyListState
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
@ -17,15 +16,14 @@ fun WeatherForecast(
|
|||
onChangeSelected: (Int) -> Unit
|
||||
) {
|
||||
state.hourlyWeatherInfo?.weatherData?.let {
|
||||
val rowState = rememberLazyListState(LocalDateTime.now().hour)
|
||||
LazyRow(state = rowState, modifier = modifier) {
|
||||
itemsIndexed(it) { index, data ->
|
||||
val hour = LocalDateTime.now().hour
|
||||
LazyRow(modifier = modifier) {
|
||||
itemsIndexed(it.subList(hour, it.size)) { index, data ->
|
||||
WeatherHour(
|
||||
data = data,
|
||||
modifier = Modifier
|
||||
.padding(horizontal = 8.dp),
|
||||
onChangeSelected = { onChangeSelected(index) }
|
||||
)
|
||||
.padding(horizontal = 8.dp)
|
||||
) { onChangeSelected(index) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue