From 52a73bf204973018cd3a8203deca8671c6f74480 Mon Sep 17 00:00:00 2001 From: Fabian Zobrist Date: Sat, 21 Jan 2023 14:47:36 +0100 Subject: [PATCH] Simplify history card. Activate open for active game. --- .../tichucounter/ui/history/HistoryView.kt | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 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 9172226..0b4788d 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 @@ -84,11 +84,7 @@ fun HistoryListItem( ) Spacer(modifier = Modifier.padding(5.dp)) Text( - text = stringResource(R.string.created, format.format(game.created)), - style = MaterialTheme.typography.labelSmall - ) - Text( - text = stringResource(R.string.modified, format.format(game.modified)), + text = format.format(game.modified), style = MaterialTheme.typography.labelSmall ) } @@ -96,14 +92,14 @@ fun HistoryListItem( Modifier .wrapContentSize() .width(70.dp)){ + + ElevatedButton(onClick = { onOpenClicked(game.gameId) }, enabled = true) { + Icon(Icons.Outlined.OpenInFull, null) + } ElevatedButton( onClick = { onDeleteClicked(game.gameId) }, enabled = !game.active ) { Icon(Icons.Outlined.Delete, null) } - - ElevatedButton(onClick = { onOpenClicked(game.gameId) }, enabled = !game.active) { - Icon(Icons.Outlined.OpenInFull, null) - } } } } @@ -113,8 +109,8 @@ fun HistoryListItem( @Composable private fun HistoryListPreview() { val tempData = listOf( - GameAndScore(false, "abc", "def", Date(), Date(), 1, 10, 50), - GameAndScore(true, "ADTH", "dogfg", Date(), Date(), 2, 20, 60), + GameAndScore(true, "abc", "def", Date(), Date(), 1, 10, 50), + GameAndScore(false, "ADTH", "dogfg", Date(), Date(), 2, 20, 60), GameAndScore(false, "TeamA3 langer Name", "TeamB3", Date(), Date(), 3, 30, 70), GameAndScore(false, "TeamA4", "TeamB4", Date(), Date(), 4, 40, 80), GameAndScore(false, "TeamA5", "TeamB5", Date(), Date(), 5, 50, 90)