From 1f740cf14b82f24efd66a4051d79e4f1fa8663c2 Mon Sep 17 00:00:00 2001 From: bqv Date: Sat, 7 Oct 2023 02:29:36 +0100 Subject: [PATCH] pause detail --- .../ui/screens/mygames/composables/LargeGameItem.kt | 12 ++++++++++-- .../ui/screens/mygames/composables/SmallGameItem.kt | 10 +++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/zenandroid/onlinego/ui/screens/mygames/composables/LargeGameItem.kt b/app/src/main/java/io/zenandroid/onlinego/ui/screens/mygames/composables/LargeGameItem.kt index 586bbb80..a31cdea6 100644 --- a/app/src/main/java/io/zenandroid/onlinego/ui/screens/mygames/composables/LargeGameItem.kt +++ b/app/src/main/java/io/zenandroid/onlinego/ui/screens/mygames/composables/LargeGameItem.kt @@ -93,8 +93,16 @@ fun LargeGameItem(game: Game, boardTheme: BoardTheme, userId: Long, onAction: (A fontSize = 12.sp, ) if (game.pauseControl.isPaused()) { + val paused = when { + game.pauseControl?.vacationWhite == true -> "vacation (white)" + game.pauseControl?.vacationBlack == true -> "vacation (black)" + game.pauseControl?.weekend == true -> "weekend" + game.pauseControl?.stoneRemoval == true -> "scoring" + game.pauseControl?.server == true -> "paused (server)" + else -> "paused" + } Text( - text = " · paused", + text = " · $paused", style = TextStyle.Default.copy( fontSize = 12.sp, ), @@ -128,4 +136,4 @@ private fun Preview() { onAction = {} ) } -} \ No newline at end of file +} diff --git a/app/src/main/java/io/zenandroid/onlinego/ui/screens/mygames/composables/SmallGameItem.kt b/app/src/main/java/io/zenandroid/onlinego/ui/screens/mygames/composables/SmallGameItem.kt index 6a70e1bd..f64eada0 100644 --- a/app/src/main/java/io/zenandroid/onlinego/ui/screens/mygames/composables/SmallGameItem.kt +++ b/app/src/main/java/io/zenandroid/onlinego/ui/screens/mygames/composables/SmallGameItem.kt @@ -82,8 +82,16 @@ fun SmallGameItem(game: Game, boardTheme: BoardTheme, userId: Long, onAction: (A ), ) if (game.pauseControl.isPaused()) { + val paused = when { + game.pauseControl?.vacationWhite == true -> "vacation (white)" + game.pauseControl?.vacationBlack == true -> "vacation (black)" + game.pauseControl?.weekend == true -> "weekend" + game.pauseControl?.stoneRemoval == true -> "scoring" + game.pauseControl?.server == true -> "paused (server)" + else -> "paused" + } Text( - text = " · paused", + text = " · $paused", color = MaterialTheme.colors.onSurface, style = TextStyle.Default.copy( fontSize = 12.sp,