Smaller switches, N/A for unplayed games, Paul's 3x40s drift test; settings-for-everyone mock-ups
- OnOff is 50 x 28 dp (was 64 x 34), same focus ring. - High scores: a game not played yet shows N/A in each column. - ProgrammeLengthsTest: three programmes 40 s over all play in full at exactly 2 minutes' drift; a fourth squeezes the next film's credits. - design/settings: five plain sections, presets, one Other TVs list (approved). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -227,11 +227,12 @@ internal fun OnOff(on: Boolean, modifier: Modifier = Modifier, enabled: Boolean
|
||||
androidx.compose.animation.core.tween(if (calm) Motion.CALM else SWITCH_MS, easing = Motion.Ease), label = "switch track")
|
||||
val along by androidx.compose.animation.core.animateFloatAsState(if (on) 1f else 0f,
|
||||
if (calm) androidx.compose.animation.core.snap() else androidx.compose.animation.core.tween(SWITCH_MS, easing = Motion.Ease), label = "switch thumb")
|
||||
Box(modifier.onFocusChanged { focused = it.isFocused }.size(64.dp, 34.dp).border(if (focused) 3.dp else 0.dp, if (focused) Yellow else Color.Transparent, RoundedCornerShape(17.dp))
|
||||
.padding(3.dp).clip(RoundedCornerShape(14.dp)).background(track.copy(alpha = if (enabled) 1f else .5f)).clickable(enabled = enabled, onClick = onClick)
|
||||
// Smaller than before (Paul, 12 November 2026: the switches looked big on the TV), with the same yellow focus ring.
|
||||
Box(modifier.onFocusChanged { focused = it.isFocused }.size(50.dp, 28.dp).border(if (focused) 3.dp else 0.dp, if (focused) Yellow else Color.Transparent, RoundedCornerShape(14.dp))
|
||||
.padding(3.dp).clip(RoundedCornerShape(11.dp)).background(track.copy(alpha = if (enabled) 1f else .5f)).clickable(enabled = enabled, onClick = onClick)
|
||||
.semantics { stateDescription = if (on) "On" else "Off" }, contentAlignment = Alignment.CenterStart) {
|
||||
// 58 dp inside, 4 dp either side, a 20 dp thumb: 30 dp of travel.
|
||||
Box(Modifier.offset(x = 30.dp * along).padding(horizontal = 4.dp).size(20.dp).clip(androidx.compose.foundation.shape.CircleShape).background(Color.White))
|
||||
// 44 dp inside, 3 dp either side, a 16 dp thumb: 22 dp of travel.
|
||||
Box(Modifier.offset(x = 22.dp * along).padding(horizontal = 3.dp).size(16.dp).clip(androidx.compose.foundation.shape.CircleShape).background(Color.White))
|
||||
}
|
||||
}
|
||||
/** How long the switch takes to slide, as in the EffectCraft design. */
|
||||
|
||||
@@ -134,12 +134,18 @@ private fun ScoreRow(game: ArcadeGame, table: ScoreTable, record: GameRecord, no
|
||||
val best = bestOf(record, table.kind).takeIf { it > 0 }?.let(table.format)
|
||||
val house = houseBest?.let { "${houseScore(table, it)} · ${if (it.mine) "You" else it.who}" }
|
||||
val end = androidx.compose.ui.text.style.TextAlign.End
|
||||
if (best == null && house == null) Text(if (game.launchable) "Not played yet" else "Coming soon", Modifier.width(ScoreColumns.best + ScoreColumns.house + if (showPlayed) ScoreColumns.played else 0.dp),
|
||||
// Not played yet: N/A in each column, so the row lines up with the others (Paul, 12 November 2026).
|
||||
if (best == null && house == null && game.launchable) {
|
||||
Text("N/A", Modifier.width(ScoreColumns.best), color = ArcadeColours.Muted, fontSize = 12.sp, maxLines = 1, textAlign = end)
|
||||
Text("N/A", Modifier.width(ScoreColumns.house), color = ArcadeColours.Muted, fontSize = 12.sp, maxLines = 1, textAlign = end)
|
||||
if (showPlayed) Text("N/A", Modifier.width(ScoreColumns.played), color = ArcadeColours.Muted, fontSize = 12.sp, maxLines = 1, textAlign = end)
|
||||
}
|
||||
else if (best == null && house == null) Text("Coming soon", Modifier.width(ScoreColumns.best + ScoreColumns.house + if (showPlayed) ScoreColumns.played else 0.dp),
|
||||
color = ArcadeColours.Muted, fontSize = 12.sp, maxLines = 1, textAlign = end)
|
||||
else {
|
||||
Text(best ?: "—", Modifier.width(ScoreColumns.best), color = if (best == null) ArcadeColours.Muted else ArcadeColours.Ink, fontSize = 13.sp, fontWeight = FontWeight.Bold, maxLines = 1, textAlign = end, style = Figures)
|
||||
Text(house.orEmpty(), Modifier.width(ScoreColumns.house), color = if (houseBest?.mine == true) ArcadeColours.Yellow else ArcadeColours.Muted, fontSize = 12.sp, maxLines = 1, overflow = TextOverflow.Ellipsis, textAlign = end, style = Figures)
|
||||
if (showPlayed) Text(playedLabel(record.lastPlayedMs, now), Modifier.width(ScoreColumns.played), color = ArcadeColours.Muted, fontSize = 12.sp, maxLines = 1, textAlign = end)
|
||||
if (showPlayed) Text(playedLabel(record.lastPlayedMs, now).ifEmpty { "N/A" }, Modifier.width(ScoreColumns.played), color = ArcadeColours.Muted, fontSize = 12.sp, maxLines = 1, textAlign = end)
|
||||
}
|
||||
Text(householdRecord ?: "—", Modifier.width(ScoreColumns.household), color = if (householdRecord == null) ArcadeColours.Muted else ArcadeColours.Ink, fontSize = 13.sp,
|
||||
fontWeight = FontWeight.SemiBold, maxLines = 1, overflow = TextOverflow.Ellipsis, textAlign = end, style = Figures)
|
||||
|
||||
@@ -79,6 +79,19 @@ class ProgrammeLengthsTest {
|
||||
assertTrue(back.entries.zipWithNext().all { (x, y) -> x.endMs <= y.startMs })
|
||||
}
|
||||
|
||||
@Test
|
||||
fun threeProgrammesFortySecondsOverAllPlayInFull() {
|
||||
// Paul's question: three in a row, each 40 seconds long. Two minutes of drift, and nothing is cut.
|
||||
var p = plan(*(0 until 6).map { entry("f$it", it * 100 * min, 100 * min) }.toTypedArray())
|
||||
for (i in 0 until 3) p = retimedPlan(p, p.entries[i].startMs, 100 * min + 40_000)!!
|
||||
assertTrue(p.entries.none { (it.fileMs ?: it.media.durationMs) > it.media.durationMs })
|
||||
assertEquals(listOf(120_000L, 120_000L, 120_000L), p.entries.drop(3).map { it.startMs - it.bookedStartMs })
|
||||
// A fourth: it plays in full too, and the fifth film's closing credits give up 40 seconds to hold the channel at two minutes.
|
||||
p = retimedPlan(p, p.entries[3].startMs, 100 * min + 40_000)!!
|
||||
assertEquals(40_000L, p.entries[4].fileMs!! - p.entries[4].media.durationMs)
|
||||
assertEquals(120_000L, p.entries[5].startMs - p.entries[5].bookedStartMs)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun tinyOverrunsNeverDriftAChannelMoreThanTwoMinutes() {
|
||||
// Thirty back-to-back episodes, each found 20 seconds longer than booked as the evening goes on.
|
||||
|
||||
Reference in New Issue
Block a user