Skip to content

Commit

Permalink
Remove blank space below BrandTopAppBar in LargeWindow mode
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBoulongne committed Sep 25, 2024
1 parent 5a86860 commit c8915b4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ private fun AppNavigationRail(
)
},
containerColor = SwissTransferTheme.colors.navigationItemBackground,
windowInsets = WindowInsets(left = 0, top = 0, right = 0, bottom = 0),
) {
navigationItems.forEach { navigationItem ->
NavigationRailItem(
icon = { NavigationIcon(false, navigationItem) },
label = {},
selected = currentDestination == navigationItem.destination,
onClick = { onClick(navigationItem.destination) },
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private fun MainScaffold(
} else {
Column {
Box(modifier = Modifier.weight(1.0f)) { content() }
HorizontalDivider()
if (navType == NavigationSuiteType.NavigationBar) HorizontalDivider()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.material3.Scaffold
import androidx.compose.material3.adaptive.navigationsuite.NavigationSuiteType
import androidx.compose.runtime.Composable
import androidx.compose.ui.unit.dp

@Composable
fun PhoneTopAppBarScaffold(
Expand All @@ -32,6 +33,11 @@ fun PhoneTopAppBarScaffold(
topBar = { if (LocalNavType.current == NavigationSuiteType.NavigationBar) phoneTopAppBar() },
floatingActionButton = floatingActionButton,
) { contentPadding ->
content(contentPadding)
val paddingValues = if (LocalNavType.current == NavigationSuiteType.NavigationBar) {
contentPadding
} else {
PaddingValues(all = 0.dp)
}
content(paddingValues)
}
}

0 comments on commit c8915b4

Please sign in to comment.