From 53c535e12794fce7de373c2a1af43e380b156f96 Mon Sep 17 00:00:00 2001 From: Christian Basler Date: Fri, 21 Mar 2025 16:52:17 +0100 Subject: [PATCH] Improve end screen --- .../composeResources/values/strings.xml | 3 ++- .../kotlin/ch/dissem/yaep/ui/common/end.kt | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/commonUI/src/commonMain/composeResources/values/strings.xml b/commonUI/src/commonMain/composeResources/values/strings.xml index 8d0c491..f0c52d8 100644 --- a/commonUI/src/commonMain/composeResources/values/strings.xml +++ b/commonUI/src/commonMain/composeResources/values/strings.xml @@ -1,7 +1,8 @@ YAEP Yet Another Einstein Puzzle - Congratulations! You solved the puzzle in %1$s + Congratulations! + You solved the puzzle in %1$s Restart diff --git a/commonUI/src/commonMain/kotlin/ch/dissem/yaep/ui/common/end.kt b/commonUI/src/commonMain/kotlin/ch/dissem/yaep/ui/common/end.kt index 5185ada..cabf2a1 100644 --- a/commonUI/src/commonMain/kotlin/ch/dissem/yaep/ui/common/end.kt +++ b/commonUI/src/commonMain/kotlin/ch/dissem/yaep/ui/common/end.kt @@ -5,7 +5,10 @@ import androidx.compose.animation.fadeIn import androidx.compose.animation.fadeOut import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height import androidx.compose.material3.Button import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text @@ -17,11 +20,13 @@ import androidx.compose.ui.draw.drawBehind import androidx.compose.ui.graphics.BlurEffect import androidx.compose.ui.graphics.graphicsLayer import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import org.jetbrains.compose.resources.stringResource import yaep.commonui.generated.resources.Res import yaep.commonui.generated.resources.restart -import yaep.commonui.generated.resources.solved +import yaep.commonui.generated.resources.solved_congrats +import yaep.commonui.generated.resources.solved_time @Composable fun EndOfGame( @@ -48,10 +53,19 @@ fun EndOfGame( .align(Alignment.Center) ) { Text( - text = stringResource(Res.string.solved, time), + text = stringResource(Res.string.solved_congrats), fontSize = 128.sp, textAlign = TextAlign.Center, + modifier = Modifier.fillMaxWidth() ) + Spacer(modifier = Modifier.height(16.dp)) + Text( + text = stringResource(Res.string.solved_time, time), + fontSize = 64.sp, + textAlign = TextAlign.Center, + modifier = Modifier.fillMaxWidth() + ) + Spacer(modifier = Modifier.height(32.dp)) Button( modifier = Modifier.align(CenterHorizontally), onClick = onRestart