Centre the nav bar's sections on the screen (from 0.108.21)
pauljd/davidson-ci: Davidson CI / quality (push) Failing after 1m49s
pauljd/davidson-ci: Davidson CI / ai-review (push) Failing after 1m40s

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-11-05 19:49:33 +00:00
co-authored by Claude Opus 5.5
parent e98628438b
commit 241048cddd
@@ -128,25 +128,27 @@ private fun OrbitApp() {
onChannelAvailable = { realChannelAvailable = it }, onRestoreChecked = { restoreChecked = true },
onGuide = { section = "TV Guide" }, onHome = { section = "Home" }, onDriveIn = { section = "Drive-In" })
}
if (!playingGame) Row(Modifier.fillMaxWidth().padding(start = 36.dp, end = 36.dp, top = 12.dp), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp)) {
Image(painterResource(R.drawable.orbit_logo), "Orbit", Modifier.width(144.dp).height(36.dp))
if (realChannelAvailable) {
// The sections sit centred on the screen, over the centred page below; the logo keeps the left, the clock the right.
if (!playingGame) Box(Modifier.fillMaxWidth().padding(start = 36.dp, end = 36.dp, top = 12.dp)) {
if (realChannelAvailable) Row(Modifier.align(Alignment.Center), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp)) {
// The whole-screen Drive-In has nothing for down to find by itself, so it's told.
val below = if (section == "Drive-In") driveInFocus else null
Spacer(Modifier.width(8.dp))
NavItem("Home", section == "Home", navFocus, below) { section = "Home" }
NavItem("What's On", section == "What's On", null, below) { section = "What's On" }
NavItem("TV Guide", section == "TV Guide", null, below) { section = "TV Guide" }
NavItem("Drive-In", section == "Drive-In", null, below) { section = "Drive-In" }
NavItem("Arcade", section == "Arcade", null, below) { section = "Arcade" }
}
Spacer(Modifier.weight(1f))
Column(horizontalAlignment = Alignment.End) {
Text(SimpleDateFormat("HH:mm", Locale.UK).format(Date(now)), color = Color.White, fontFamily = BarlowCondensed, fontSize = 20.sp)
Text(SimpleDateFormat("EEEE d MMMM", Locale.UK).format(Date(now)), color = Muted, fontSize = 10.sp)
}
if (realChannelAvailable) HomeCard(Modifier.size(38.dp, 32.dp).focusProperties { if (section == "Drive-In") down = driveInFocus }, onClick = { section = "Connect Emby" }) { focused ->
Image(painterResource(R.drawable.orbit_icon_gear), "Settings", Modifier.fillMaxSize().padding(5.dp), colorFilter = if (focused) ColorFilter.tint(Navy) else null)
Row(Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp)) {
Image(painterResource(R.drawable.orbit_logo), "Orbit", Modifier.width(144.dp).height(36.dp))
Spacer(Modifier.weight(1f))
Column(horizontalAlignment = Alignment.End) {
Text(SimpleDateFormat("HH:mm", Locale.UK).format(Date(now)), color = Color.White, fontFamily = BarlowCondensed, fontSize = 20.sp)
Text(SimpleDateFormat("EEEE d MMMM", Locale.UK).format(Date(now)), color = Muted, fontSize = 10.sp)
}
if (realChannelAvailable) HomeCard(Modifier.size(38.dp, 32.dp).focusProperties { if (section == "Drive-In") down = driveInFocus }, onClick = { section = "Connect Emby" }) { focused ->
Image(painterResource(R.drawable.orbit_icon_gear), "Settings", Modifier.fillMaxSize().padding(5.dp), colorFilter = if (focused) ColorFilter.tint(Navy) else null)
}
}
}
}