Skip to content

Commit

Permalink
💄 Properly remove edge-to-edge without black bars (#817)
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoColman authored Jan 27, 2025
1 parent 32e3238 commit 5abb37d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 1 addition & 3 deletions app/src/main/kotlin/br/com/colman/petals/navigation/Page.kt
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ fun BottomNavigationBar(navController: NavHostController) {
val navBackStackEntry by navController.currentBackStackEntryAsState()
val currentRoute = navBackStackEntry?.destination?.route

BottomNavigation(
Modifier.padding(bottom = WindowInsets.systemBars.asPaddingValues().calculateBottomPadding())
) {
BottomNavigation(WindowInsets(bottom = WindowInsets.systemBars.asPaddingValues().calculateBottomPadding())) {
Page.entries.forEach { page ->
BottomNavigationItem(
modifier = Modifier.testTag(page.name),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement.SpaceBetween
import androidx.compose.foundation.layout.Arrangement.spacedBy
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues
Expand Down Expand Up @@ -60,7 +61,7 @@ import org.koin.compose.koinInject
@Composable
fun MyTopAppBar(navController: NavController, options: (@Composable () -> Unit)? = null) {
TopAppBar(
Modifier.padding(top = WindowInsets.systemBars.asPaddingValues().calculateTopPadding())
contentPadding = PaddingValues(top = WindowInsets.systemBars.asPaddingValues().calculateTopPadding())
) {
Box(
Modifier.padding(16.dp).height(56.dp).fillMaxWidth()
Expand Down

0 comments on commit 5abb37d

Please sign in to comment.