The map buttons wrap into a second column on a short screen, and keep clear of the nav bar's row while it's hidden, instead of running under it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
HawkandClaude Opus 5.5 committed 2026-11-22 17:36:30 -08:00
1 parent 4e3f8e6657
commit 90203eb1e7
2 files changed
+15 -3

No files matched your search

@@ -274,7 +274,7 @@ fun CarUi() {
// Home never leaves the composition; other screens cover it. Dropping it // Home never leaves the composition; other screens cover it. Dropping it
// would tear down the map's surface, and coming back would then show black // would tear down the map's surface, and coming back would then show black
// while the nav app redrew on a new one. // while the nav app redrew on a new one.
CompositionLocalProvider(LocalNavBarInset provides homeInset) { CarHome() } CompositionLocalProvider(LocalNavBarInset provides homeInset, LocalNavBarRow provides NAV_BAR_HEIGHT) { CarHome() }
} }
// The keyboard takes the nav bar's row instead of squeezing in above it - // The keyboard takes the nav bar's row instead of squeezing in above it -
// nothing on the nav bar is useful mid-type, and the screen is too small to // nothing on the nav bar is useful mid-type, and the screen is too small to
@@ -403,6 +403,12 @@ internal val NAV_BAR_HEIGHT = 56.dp
*/ */
internal val LocalNavBarInset = androidx.compose.runtime.compositionLocalOf { 0.dp } internal val LocalNavBarInset = androidx.compose.runtime.compositionLocalOf { 0.dp }
/**
* The floating nav bar's row over Home, whether it shows right now or not: what stays clear so
* nothing jumps as it slides in and out. Zero on screens that keep a row for the bar themselves.
*/
internal val LocalNavBarRow = androidx.compose.runtime.compositionLocalOf { 0.dp }
/** /**
* A single blocking screen, shown once per install before anything else the car screen can show - * A single blocking screen, shown once per install before anything else the car screen can show -
* Home included. The phone's own setup guide carries the same warning, but a driver who plugs in * Home included. The phone's own setup guide carries the same warning, but a driver who plugs in
@@ -277,6 +277,9 @@ internal fun RightEdgeControls(
) )
Column( Column(
modifier modifier
// Clear of the nav bar's row even while it's hidden, so the buttons don't jump or
// wrap differently each time it slides in or out.
.padding(bottom = maxOf(0.dp, LocalNavBarRow.current - LocalNavBarInset.current))
.alpha(alpha) .alpha(alpha)
.focusRequester(knobFocus) .focusRequester(knobFocus)
.focusGroup() .focusGroup()
@@ -317,10 +320,13 @@ internal fun RightEdgeControls(
} }
} }
if (mapActions.isNotEmpty() && !(folded && open)) { if (mapActions.isNotEmpty() && !(folded && open)) {
Column( // Wraps into a second column on a short screen: a 1280x480 SOOEMAKA had the last
// buttons under the nav bar, out of reach.
androidx.compose.foundation.layout.FlowColumn(
mapActionsModifier, mapActionsModifier,
horizontalAlignment = alignment,
verticalArrangement = Arrangement.spacedBy(8.dp), verticalArrangement = Arrangement.spacedBy(8.dp),
horizontalArrangement = Arrangement.spacedBy(8.dp),
itemHorizontalAlignment = alignment,
) { ) {
mapActions.forEach { ActionButton(it) } mapActions.forEach { ActionButton(it) }
} }