fix(US-06): match preset buttons to web version

Four presets: 100 (slow), 120 (brisk), 130 (jog), 140 (push),
each showing the BPM and label to match jeena.net/pacer/.
This commit is contained in:
Jeena 2026-03-09 08:12:39 +00:00
parent 4fa725e4ed
commit a9bde4ffc7

View file

@ -43,7 +43,12 @@ private val BG = Color(0xFF0D0D0D)
private val GREEN = Green80 private val GREEN = Green80
private val GREEN_DIM = Color(0xFF004D14) private val GREEN_DIM = Color(0xFF004D14)
private val PRESETS = listOf(80, 100, 120, 130, 140, 160) private val PRESETS = listOf(
100 to "slow",
120 to "brisk",
130 to "jog",
140 to "push",
)
@Composable @Composable
fun PacerScreen(viewModel: PacerViewModel, modifier: Modifier = Modifier) { fun PacerScreen(viewModel: PacerViewModel, modifier: Modifier = Modifier) {
@ -153,10 +158,10 @@ fun PacerScreen(viewModel: PacerViewModel, modifier: Modifier = Modifier) {
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceEvenly horizontalArrangement = Arrangement.SpaceEvenly
) { ) {
PRESETS.forEach { preset -> PRESETS.forEach { (preset, label) ->
OutlinedButton( OutlinedButton(
onClick = { viewModel.updateBpm(preset) }, onClick = { viewModel.updateBpm(preset) },
modifier = Modifier.size(width = 52.dp, height = 36.dp), modifier = Modifier.size(width = 72.dp, height = 52.dp),
contentPadding = androidx.compose.foundation.layout.PaddingValues(0.dp), contentPadding = androidx.compose.foundation.layout.PaddingValues(0.dp),
colors = ButtonDefaults.outlinedButtonColors( colors = ButtonDefaults.outlinedButtonColors(
contentColor = if (bpm == preset) BG else GREEN, contentColor = if (bpm == preset) BG else GREEN,
@ -164,11 +169,19 @@ fun PacerScreen(viewModel: PacerViewModel, modifier: Modifier = Modifier) {
), ),
border = androidx.compose.foundation.BorderStroke(1.dp, GREEN.copy(alpha = 0.5f)) border = androidx.compose.foundation.BorderStroke(1.dp, GREEN.copy(alpha = 0.5f))
) { ) {
Text( Column(horizontalAlignment = Alignment.CenterHorizontally) {
text = "$preset", Text(
fontSize = 13.sp, text = "$preset",
fontFamily = FontFamily.Monospace fontSize = 14.sp,
) fontWeight = FontWeight.Bold,
fontFamily = FontFamily.Monospace
)
Text(
text = label,
fontSize = 10.sp,
fontFamily = FontFamily.Monospace
)
}
} }
} }
} }