Merge branch 'hotfix/2.3.1'
This commit is contained in:
@@ -53,7 +53,6 @@ import androidx.compose.ui.res.stringResource
|
|||||||
import androidx.compose.ui.text.style.TextOverflow
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import kotlinx.coroutines.delay
|
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import me.zobrist.tichucounter.R
|
import me.zobrist.tichucounter.R
|
||||||
import me.zobrist.tichucounter.data.GameWithScores
|
import me.zobrist.tichucounter.data.GameWithScores
|
||||||
@@ -160,31 +159,23 @@ fun HistoryList(
|
|||||||
onDeleteAllClicked: () -> Unit,
|
onDeleteAllClicked: () -> Unit,
|
||||||
lazyListState: LazyListState = LazyListState(),
|
lazyListState: LazyListState = LazyListState(),
|
||||||
) {
|
) {
|
||||||
val scope = rememberCoroutineScope()
|
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
LazyColumn(state = lazyListState) {
|
LazyColumn(state = lazyListState) {
|
||||||
items(
|
items(
|
||||||
items = games,
|
items = games,
|
||||||
key = { it.game.uid }) { item ->
|
key = { it.hashCode() }) {
|
||||||
if (item.game.active) {
|
if (it.game.active) {
|
||||||
HistoryListItem(
|
HistoryListItem(
|
||||||
item,
|
it,
|
||||||
Modifier
|
Modifier
|
||||||
.animateItemPlacement()
|
.animateItemPlacement()
|
||||||
.padding(2.dp)
|
.padding(2.dp)
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
DismissibleHistoryListItem(
|
DismissibleHistoryListItem(
|
||||||
item,
|
it,
|
||||||
Modifier.animateItemPlacement(),
|
Modifier.animateItemPlacement(),
|
||||||
{
|
onOpenClicked,
|
||||||
onOpenClicked(it)
|
|
||||||
scope.launch {
|
|
||||||
delay(100)
|
|
||||||
lazyListState.animateScrollToItem(0)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onDeleteClicked
|
onDeleteClicked
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user