car: the nav bar takes the screen's own background everywhere, and the car isn't sent the same cover every second

This commit is contained in:
Seb3thehacker committed 2026-10-26 20:36:28 -07:00
1 parent e1948a823f
commit de370751a0
2 files changed
+7 -9

No files matched your search

@@ -79,7 +79,6 @@ import app.seb3thehacker.gearslip.car.theme.GsColors
import app.seb3thehacker.gearslip.car.theme.withTintedSurfaces
import app.seb3thehacker.gearslip.car.theme.GsIconBox
import app.seb3thehacker.gearslip.car.theme.GsIconButton
import app.seb3thehacker.gearslip.car.theme.gsBarShadow
import app.seb3thehacker.gearslip.car.theme.GsButton
import app.seb3thehacker.gearslip.car.theme.GsTone
import app.seb3thehacker.gearslip.car.theme.gsColors
@@ -166,14 +165,11 @@ internal fun CarNavBar(navigator: CarNavigator) {
val frame by CarEnvironment.frame.collectAsState()
val running = rememberRunningApps()
// A full-width strip along the bottom, casting the theme's panel shadow up onto the map so the
// bar sits above it rather than beside it. Over the player it's see-through instead, so the
// player's background and the cover's glow carry on behind it.
// A full-width strip along the bottom in the screens' own background, so it reads as part of
// the screen above rather than a panel on it. Over the player it's see-through, so the
// cover's glow carries on behind it.
val overPlayer = navigator.current == CarScreen.Media
Surface(
if (overPlayer) Modifier else Modifier.gsBarShadow(),
color = if (overPlayer) androidx.compose.ui.graphics.Color.Transparent else MaterialTheme.colorScheme.surfaceContainer,
) {
Surface(color = if (overPlayer) androidx.compose.ui.graphics.Color.Transparent else MaterialTheme.colorScheme.background) {
BoxWithConstraints(Modifier.fillMaxWidth().height(NAV_BAR_HEIGHT).padding(horizontal = 10.dp)) {
Row(Modifier.fillMaxSize(), verticalAlignment = Alignment.CenterVertically) {
// Home and Apps are two different places now, not a toggle on one button - the
@@ -85,7 +85,9 @@ class CarMediaStatus(
}
private fun sendTrack(now: NowPlaying) {
val key = "${now.title}\u0000${now.artist}\u0000${now.album}\u0000${now.durationMs}\u0000${now.art?.generationId}"
// Whether there's a cover, not which bitmap: some apps (Metrolist) hand over a fresh copy
// of the same cover with every update, and resending it each second wastes the link.
val key = "${now.title}\u0000${now.artist}\u0000${now.album}\u0000${now.durationMs}\u0000${now.art != null}"
if (key == sentTrack) return
sentTrack = key
var body = Protobuf.stringField(1, now.title) +