diff --git a/app/src/main/java/ru/spbu/depnav/ui/component/MapSearchBar.kt b/app/src/main/java/ru/spbu/depnav/ui/component/MapSearchBar.kt index e0892f5f..85b9f230 100644 --- a/app/src/main/java/ru/spbu/depnav/ui/component/MapSearchBar.kt +++ b/app/src/main/java/ru/spbu/depnav/ui/component/MapSearchBar.kt @@ -33,7 +33,7 @@ import androidx.compose.foundation.layout.calculateEndPadding import androidx.compose.foundation.layout.calculateStartPadding import androidx.compose.foundation.layout.only import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.systemBars +import androidx.compose.foundation.layout.safeDrawing import androidx.compose.foundation.layout.windowInsetsPadding import androidx.compose.material.icons.Icons import androidx.compose.material.icons.automirrored.rounded.ArrowBack @@ -95,7 +95,7 @@ fun MapSearchBar( label = "Map search bar activation animation progress" ) - val (insetsStartPadding, insetsEndPadding) = with(WindowInsets.systemBars.asPaddingValues()) { + val (insetsStartPadding, insetsEndPadding) = with(WindowInsets.safeDrawing.asPaddingValues()) { val layoutDirection = LocalLayoutDirection.current calculateStartPadding(layoutDirection) to calculateEndPadding(layoutDirection) } @@ -116,7 +116,7 @@ fun MapSearchBar( modifier = Modifier .run { if (active) padding(start = outerStartPadding, end = outerEndPadding) - else windowInsetsPadding(WindowInsets.systemBars.only(WindowInsetsSides.Horizontal)) + else windowInsetsPadding(WindowInsets.safeDrawing.only(WindowInsetsSides.Horizontal)) } .then(modifier), placeholder = { @@ -157,7 +157,7 @@ fun MapSearchBar( .padding( start = innerStartPadding, end = innerEndPadding, - bottom = WindowInsets.systemBars + bottom = WindowInsets.safeDrawing .asPaddingValues() .calculateBottomPadding() ) diff --git a/app/src/main/java/ru/spbu/depnav/ui/screen/MapScreen.kt b/app/src/main/java/ru/spbu/depnav/ui/screen/MapScreen.kt index d086849a..c5405e0c 100644 --- a/app/src/main/java/ru/spbu/depnav/ui/screen/MapScreen.kt +++ b/app/src/main/java/ru/spbu/depnav/ui/screen/MapScreen.kt @@ -36,8 +36,8 @@ import androidx.compose.foundation.layout.exclude import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.only import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.safeContentPadding -import androidx.compose.foundation.layout.systemBars +import androidx.compose.foundation.layout.safeDrawing +import androidx.compose.foundation.layout.safeDrawingPadding import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.windowInsetsPadding import androidx.compose.foundation.shape.CornerSize @@ -268,7 +268,7 @@ private fun BoxScope.AnimatedFloorSwitch( visible = visible, modifier = Modifier .align(Alignment.TopEnd) - .safeContentPadding() + .safeDrawingPadding() .padding(top = 64.dp) // Estimated search bar height .padding(DEFAULT_PADDING), enter = slideInHorizontally(initialOffsetX = horizontalOffset) + fadeIn(), @@ -293,7 +293,7 @@ private fun BoxScope.AnimatedBottom(pinnedMarker: MarkerWithText?, showZoomInHin ) { Surface( modifier = Modifier - .windowInsetsPadding(WindowInsets.systemBars.only(WindowInsetsSides.Horizontal)) + .windowInsetsPadding(WindowInsets.safeDrawing.only(WindowInsetsSides.Horizontal)) .width(640.dp), shape = MaterialTheme.shapes.large.copy( bottomStart = CornerSize(0), @@ -320,7 +320,9 @@ private fun BoxScope.AnimatedBottom(pinnedMarker: MarkerWithText?, showZoomInHin description = markerText.description, modifier = Modifier .padding(DEFAULT_PADDING) - .windowInsetsPadding(WindowInsets.systemBars.only(WindowInsetsSides.Bottom)) + .windowInsetsPadding( + WindowInsets.safeDrawing.only(WindowInsetsSides.Bottom) + ) ) { MarkerView( title = markerText.title ?: stringResource(R.string.no_title), @@ -337,7 +339,7 @@ private fun BoxScope.AnimatedBottom(pinnedMarker: MarkerWithText?, showZoomInHin modifier = Modifier .align(Alignment.BottomCenter) .windowInsetsPadding( - WindowInsets.systemBars.run { exclude(only(WindowInsetsSides.Top)) } + WindowInsets.safeDrawing.run { exclude(only(WindowInsetsSides.Top)) } ), enter = fadeIn(), exit = fadeOut()