From 67e803f91351c6865914a5c7b16ed0ac88effe5e Mon Sep 17 00:00:00 2001 From: Fabian Zobrist Date: Wed, 27 Sep 2023 22:45:10 +0200 Subject: [PATCH] Revert "Scroll to top on game activated." This reverts commit fa9786de046ebf17503bd3474f9415ee6696f4e6. # Conflicts: # app/src/main/java/me/zobrist/tichucounter/ui/history/HistoryView.kt --- .../tichucounter/ui/history/HistoryView.kt | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/me/zobrist/tichucounter/ui/history/HistoryView.kt b/app/src/main/java/me/zobrist/tichucounter/ui/history/HistoryView.kt index cb4cfd7..17cf750 100644 --- a/app/src/main/java/me/zobrist/tichucounter/ui/history/HistoryView.kt +++ b/app/src/main/java/me/zobrist/tichucounter/ui/history/HistoryView.kt @@ -53,7 +53,6 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp -import kotlinx.coroutines.delay import kotlinx.coroutines.launch import me.zobrist.tichucounter.R import me.zobrist.tichucounter.data.GameWithScores @@ -160,31 +159,23 @@ fun HistoryList( onDeleteAllClicked: () -> Unit, lazyListState: LazyListState = LazyListState(), ) { - val scope = rememberCoroutineScope() - Row { LazyColumn(state = lazyListState) { items( items = games, - key = { it.game.uid }) { item -> - if (item.game.active) { + key = { it.hashCode() }) { + if (it.game.active) { HistoryListItem( - item, + it, Modifier .animateItemPlacement() .padding(2.dp) ) } else { DismissibleHistoryListItem( - item, + it, Modifier.animateItemPlacement(), - { - onOpenClicked(it) - scope.launch { - delay(100) - lazyListState.animateScrollToItem(0) - } - }, + onOpenClicked, onDeleteClicked ) }