diff --git a/app/src/main/java/org/scottishtecharmy/soundscape/screens/home/HomeScreen.kt b/app/src/main/java/org/scottishtecharmy/soundscape/screens/home/HomeScreen.kt index 18c91a08..795130ef 100644 --- a/app/src/main/java/org/scottishtecharmy/soundscape/screens/home/HomeScreen.kt +++ b/app/src/main/java/org/scottishtecharmy/soundscape/screens/home/HomeScreen.kt @@ -1,7 +1,11 @@ package org.scottishtecharmy.soundscape.screens.home import android.util.Log +import androidx.compose.foundation.layout.WindowInsets +import androidx.compose.foundation.layout.safeDrawing +import androidx.compose.foundation.layout.windowInsetsPadding import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle @@ -88,6 +92,7 @@ fun HomeScreen( Settings( onNavigateUp = { navController.navigateUp() }, uiState = uiState.value, + modifier = Modifier.windowInsetsPadding(WindowInsets.safeDrawing), ) } @@ -113,6 +118,7 @@ fun HomeScreen( longitude = state.value.location?.longitude, navController = navController, heading = state.value.heading, + modifier = Modifier.windowInsetsPadding(WindowInsets.safeDrawing), ) } @@ -123,7 +129,9 @@ fun HomeScreen( ) { composable("${HomeRoutes.MarkersAndRoutes.route}/{tab}") { backStackEntry -> val selectedTab = backStackEntry.arguments?.getString("tab") - MarkersAndRoutesScreen(mainNavController = navController, selectedTab = selectedTab) + MarkersAndRoutesScreen(mainNavController = navController, + selectedTab = selectedTab, + modifier = Modifier.windowInsetsPadding(WindowInsets.safeDrawing)) } } diff --git a/app/src/main/java/org/scottishtecharmy/soundscape/screens/home/locationDetails/LocationDetailsScreen.kt b/app/src/main/java/org/scottishtecharmy/soundscape/screens/home/locationDetails/LocationDetailsScreen.kt index fa0962b6..8c7ff970 100644 --- a/app/src/main/java/org/scottishtecharmy/soundscape/screens/home/locationDetails/LocationDetailsScreen.kt +++ b/app/src/main/java/org/scottishtecharmy/soundscape/screens/home/locationDetails/LocationDetailsScreen.kt @@ -62,6 +62,7 @@ fun LocationDetailsScreen( onNavigateUp: () -> Unit, navController: NavHostController, viewModel: LocationDetailsViewModel = hiltViewModel(), + modifier: Modifier = Modifier ) { LocationDetails( onNavigateUp = onNavigateUp, @@ -76,6 +77,7 @@ fun LocationDetailsScreen( latitude = latitude, longitude = longitude, heading = heading, + modifier = modifier ) } diff --git a/app/src/main/java/org/scottishtecharmy/soundscape/screens/home/settings/Settings.kt b/app/src/main/java/org/scottishtecharmy/soundscape/screens/home/settings/Settings.kt index d0204492..0c25af2a 100644 --- a/app/src/main/java/org/scottishtecharmy/soundscape/screens/home/settings/Settings.kt +++ b/app/src/main/java/org/scottishtecharmy/soundscape/screens/home/settings/Settings.kt @@ -37,11 +37,12 @@ fun SettingsPreview() { @Composable fun Settings( onNavigateUp: () -> Unit, - uiState : SettingsViewModel.SettingsUiState) + uiState: SettingsViewModel.SettingsUiState, + modifier: Modifier = Modifier, +) { ProvidePreferenceLocals { - LazyColumn { - + LazyColumn (modifier = modifier){ stickyHeader { Surface { CustomAppBar(stringResource(R.string.general_alert_settings), diff --git a/app/src/main/java/org/scottishtecharmy/soundscape/screens/markers_routes/screens/MarkersAndRoutesScreen.kt b/app/src/main/java/org/scottishtecharmy/soundscape/screens/markers_routes/screens/MarkersAndRoutesScreen.kt index d4c87638..26cd978a 100644 --- a/app/src/main/java/org/scottishtecharmy/soundscape/screens/markers_routes/screens/MarkersAndRoutesScreen.kt +++ b/app/src/main/java/org/scottishtecharmy/soundscape/screens/markers_routes/screens/MarkersAndRoutesScreen.kt @@ -20,7 +20,8 @@ import org.scottishtecharmy.soundscape.ui.theme.SoundscapeTheme @Composable fun MarkersAndRoutesScreen( mainNavController: NavController, - selectedTab: String? + selectedTab: String?, + modifier: Modifier ) { // Nested navController for the tab navigation inside MarkersAndRoutes val nestedNavController = rememberNavController() @@ -30,6 +31,7 @@ fun MarkersAndRoutesScreen( val showAddIcon = currentRoute == ScreensForMarkersAndRoutes.Routes.route Scaffold( + modifier = modifier, topBar = { Column { MarkersAndRoutesAppBar( @@ -60,6 +62,8 @@ fun MarkersAndRoutesPreview() { SoundscapeTheme { MarkersAndRoutesScreen( mainNavController = rememberNavController(), - selectedTab = ScreensForMarkersAndRoutes.Markers.route) + selectedTab = ScreensForMarkersAndRoutes.Markers.route, + modifier = Modifier + ) } }