diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/geocaches/NewGeocacheButton.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/geocaches/NewGeocacheButton.kt index 5643b4d6a8..13ed7e860b 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/geocaches/NewGeocacheButton.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/geocaches/NewGeocacheButton.kt @@ -20,32 +20,32 @@ */ package com.vitorpamplona.amethyst.ui.screen.loggedIn.geocaches -import androidx.compose.foundation.layout.size +import androidx.compose.foundation.shape.CircleShape import androidx.compose.material3.FloatingActionButton import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import androidx.compose.ui.unit.dp import com.vitorpamplona.amethyst.commons.icons.symbols.Icon import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.geocache_hide_a_cache import com.vitorpamplona.amethyst.ui.navigation.navs.INav import com.vitorpamplona.amethyst.ui.navigation.routes.Route +import com.vitorpamplona.amethyst.ui.theme.Size26Modifier +import com.vitorpamplona.amethyst.ui.theme.Size55Modifier import org.jetbrains.compose.resources.stringResource @Composable fun NewGeocacheButton(nav: INav) { FloatingActionButton( onClick = { nav.nav(Route.NewGeocache()) }, - modifier = Modifier.size(55.dp), - shape = MaterialTheme.shapes.large, + modifier = Size55Modifier, + shape = CircleShape, containerColor = MaterialTheme.colorScheme.primary, ) { Icon( symbol = MaterialSymbols.Add, contentDescription = stringResource(Res.string.geocache_hide_a_cache), - modifier = Modifier.size(26.dp), + modifier = Size26Modifier, tint = MaterialTheme.colorScheme.onPrimary, ) } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/geocaches/detail/GeocacheAddToHuntSheet.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/geocaches/detail/GeocacheAddToHuntSheet.kt index 01cb7a6f36..7e92744df2 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/geocaches/detail/GeocacheAddToHuntSheet.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/geocaches/detail/GeocacheAddToHuntSheet.kt @@ -24,7 +24,10 @@ import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.navigationBarsPadding import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.material3.ExperimentalMaterial3Api @@ -197,7 +200,10 @@ fun GeocacheAddToHuntSheet( } } - Text("", modifier = Modifier.padding(bottom = 24.dp)) + // The sheet's last row has to clear the system navigation, and an empty Text was + // standing in for that. Spacer + the real inset is both honest and correct on + // gesture navigation, where the reserved band is much smaller. + Spacer(Modifier.navigationBarsPadding().height(16.dp)) } } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/geocaches/detail/GeocacheDetailScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/geocaches/detail/GeocacheDetailScreen.kt index 40454fe317..441fd17c02 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/geocaches/detail/GeocacheDetailScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/geocaches/detail/GeocacheDetailScreen.kt @@ -35,6 +35,7 @@ import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.navigationBarsPadding import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width @@ -467,7 +468,15 @@ private fun GeocacheActionBar( Surface(tonalElevation = 3.dp) { Column( - Modifier.fillMaxWidth().padding(horizontal = 16.dp, vertical = 10.dp), + // navigationBarsPadding on the *content* rather than the Surface: the bar's + // background still runs to the bottom of the screen, while the buttons sit above + // the 3-button navigation instead of underneath it. Material3's Scaffold passes + // its window insets to the content slot only -- a bottomBar is expected to handle + // its own, which this one was not doing. + Modifier + .fillMaxWidth() + .navigationBarsPadding() + .padding(horizontal = 16.dp, vertical = 10.dp), verticalArrangement = Arrangement.spacedBy(8.dp), ) { // The status line replaces the find buttons rather than sitting above them, so the diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/geocaches/detail/GeocacheLogSheet.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/geocaches/detail/GeocacheLogSheet.kt index f82117bc9d..1de6e9c6a3 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/geocaches/detail/GeocacheLogSheet.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/geocaches/detail/GeocacheLogSheet.kt @@ -26,6 +26,7 @@ import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.navigationBarsPadding import androidx.compose.foundation.layout.padding import androidx.compose.material3.Button import androidx.compose.material3.ExperimentalMaterial3Api @@ -140,7 +141,7 @@ fun GeocacheLogSheet( ) { Text(stringResource(Res.string.geocache_log_post)) } } - Spacer(Modifier.height(20.dp)) + Spacer(Modifier.navigationBarsPadding().height(20.dp)) } } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/geocaches/detail/GeocacheOwnerActions.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/geocaches/detail/GeocacheOwnerActions.kt index a2a04d0dd5..92dfd9a082 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/geocaches/detail/GeocacheOwnerActions.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/geocaches/detail/GeocacheOwnerActions.kt @@ -24,6 +24,7 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.navigationBarsPadding import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.material3.AlertDialog @@ -205,7 +206,7 @@ fun GeocacheOwnerActions( color = MaterialTheme.colorScheme.onSurfaceVariant, textAlign = TextAlign.Center, ) - Spacer(Modifier.height(24.dp)) + Spacer(Modifier.navigationBarsPadding().height(24.dp)) } } }