Simplify history card. Activate open for active game.
This commit is contained in:
@@ -84,11 +84,7 @@ fun HistoryListItem(
|
|||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.padding(5.dp))
|
Spacer(modifier = Modifier.padding(5.dp))
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.created, format.format(game.created)),
|
text = format.format(game.modified),
|
||||||
style = MaterialTheme.typography.labelSmall
|
|
||||||
)
|
|
||||||
Text(
|
|
||||||
text = stringResource(R.string.modified, format.format(game.modified)),
|
|
||||||
style = MaterialTheme.typography.labelSmall
|
style = MaterialTheme.typography.labelSmall
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -96,14 +92,14 @@ fun HistoryListItem(
|
|||||||
Modifier
|
Modifier
|
||||||
.wrapContentSize()
|
.wrapContentSize()
|
||||||
.width(70.dp)){
|
.width(70.dp)){
|
||||||
|
|
||||||
|
ElevatedButton(onClick = { onOpenClicked(game.gameId) }, enabled = true) {
|
||||||
|
Icon(Icons.Outlined.OpenInFull, null)
|
||||||
|
}
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onClick = { onDeleteClicked(game.gameId) }, enabled = !game.active ) {
|
onClick = { onDeleteClicked(game.gameId) }, enabled = !game.active ) {
|
||||||
Icon(Icons.Outlined.Delete, null)
|
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
|
@Composable
|
||||||
private fun HistoryListPreview() {
|
private fun HistoryListPreview() {
|
||||||
val tempData = listOf(
|
val tempData = listOf(
|
||||||
GameAndScore(false, "abc", "def", Date(), Date(), 1, 10, 50),
|
GameAndScore(true, "abc", "def", Date(), Date(), 1, 10, 50),
|
||||||
GameAndScore(true, "ADTH", "dogfg", Date(), Date(), 2, 20, 60),
|
GameAndScore(false, "ADTH", "dogfg", Date(), Date(), 2, 20, 60),
|
||||||
GameAndScore(false, "TeamA3 langer Name", "TeamB3", Date(), Date(), 3, 30, 70),
|
GameAndScore(false, "TeamA3 langer Name", "TeamB3", Date(), Date(), 3, 30, 70),
|
||||||
GameAndScore(false, "TeamA4", "TeamB4", Date(), Date(), 4, 40, 80),
|
GameAndScore(false, "TeamA4", "TeamB4", Date(), Date(), 4, 40, 80),
|
||||||
GameAndScore(false, "TeamA5", "TeamB5", Date(), Date(), 5, 50, 90)
|
GameAndScore(false, "TeamA5", "TeamB5", Date(), Date(), 5, 50, 90)
|
||||||
|
|||||||
Reference in New Issue
Block a user