Improve end screen

This commit is contained in:
Christian Basler
2025-03-21 16:52:17 +01:00
parent c27e4a7f6f
commit 53c535e127
2 changed files with 18 additions and 3 deletions

View File

@@ -1,7 +1,8 @@
<resources> <resources>
<string name="app_name">YAEP</string> <string name="app_name">YAEP</string>
<string name="app_name_full">Yet Another Einstein Puzzle</string> <string name="app_name_full">Yet Another Einstein Puzzle</string>
<string name="solved">Congratulations! You solved the puzzle in %1$s</string> <string name="solved_congrats">Congratulations!</string>
<string name="solved_time">You solved the puzzle in %1$s</string>
<string name="restart">Restart</string> <string name="restart">Restart</string>
<!-- Animals --> <!-- Animals -->

View File

@@ -5,7 +5,10 @@ import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut import androidx.compose.animation.fadeOut
import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize 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.Button
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text 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.BlurEffect
import androidx.compose.ui.graphics.graphicsLayer import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import org.jetbrains.compose.resources.stringResource import org.jetbrains.compose.resources.stringResource
import yaep.commonui.generated.resources.Res import yaep.commonui.generated.resources.Res
import yaep.commonui.generated.resources.restart 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 @Composable
fun EndOfGame( fun EndOfGame(
@@ -48,10 +53,19 @@ fun EndOfGame(
.align(Alignment.Center) .align(Alignment.Center)
) { ) {
Text( Text(
text = stringResource(Res.string.solved, time), text = stringResource(Res.string.solved_congrats),
fontSize = 128.sp, fontSize = 128.sp,
textAlign = TextAlign.Center, 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( Button(
modifier = Modifier.align(CenterHorizontally), modifier = Modifier.align(CenterHorizontally),
onClick = onRestart onClick = onRestart