Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import androidx.compose.foundation.combinedClickable
import androidx.compose.foundation.layout.FlowRow
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.WindowInsetsSides
import androidx.compose.foundation.layout.only
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
Expand All @@ -40,6 +41,7 @@ import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.ScaffoldDefaults
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text
import androidx.compose.material3.pulltorefresh.PullToRefreshBox
Expand Down Expand Up @@ -210,8 +212,12 @@ fun HomeScreen(

Scaffold(
// The header draws its own status-bar inset so it can run under the bar; letting the
// Scaffold consume it here would leave a band of plain background above the pane.
contentWindowInsets = WindowInsets(0),
// Scaffold consume it here would leave a band of plain background above the pane. The
// bottom is the Scaffold's to reserve, though: with the panels floating there is no
// navigation container underneath to have taken it, and the last row of the feed would end
// up behind three-button navigation. Already-consumed insets are excluded from this, so it
// still adds nothing in the arrangements where a container is there.
contentWindowInsets = ScaffoldDefaults.contentWindowInsets.only(WindowInsetsSides.Bottom),
snackbarHost = { VectorSnackbarHost(snackbars) },
) { padding ->
val listState = rememberLazyListState()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import androidx.compose.foundation.layout.Spacer
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
Expand Down Expand Up @@ -1037,7 +1038,19 @@ private fun ApplyBar(
) {
Surface(tonalElevation = 3.dp, color = MaterialTheme.colorScheme.surfaceContainerHigh) {
Row(
modifier = Modifier.fillMaxWidth().padding(horizontal = 16.dp, vertical = 10.dp),
// The bar is the last child of the window, and this screen is a detail screen: the
// navigation container is hidden here, so nothing above has reserved the system bars
// and Scaffold hands its bottom slot the whole window. Without this the buttons sit
// under three-button navigation, where what is left of them is a few pixels tall.
//
// Inside the Surface rather than on it, so the tonal fill still runs to the bottom
// edge and the bar reads as one surface rather than as a strip floating above the
// system's own. Insets already consumed count for nothing here, so the same call is
// correct in the arrangements where a container below has taken them.
modifier =
Modifier.fillMaxWidth()
.navigationBarsPadding()
.padding(horizontal = 16.dp, vertical = 10.dp),
verticalAlignment = Alignment.CenterVertically,
) {
Column(Modifier.weight(1f)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import androidx.compose.foundation.layout.Spacer
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
Expand Down Expand Up @@ -120,7 +121,9 @@ fun TroubleshootScreen(
bottomBar = {
Surface(tonalElevation = 3.dp) {
Row(
modifier = Modifier.fillMaxWidth().padding(20.dp),
// Scaffold places its bottom slot against the bottom of the window and leaves
// the system bars to it, so the button says where it stands itself.
modifier = Modifier.fillMaxWidth().navigationBarsPadding().padding(20.dp),
horizontalArrangement = Arrangement.Center,
) {
Button(onClick = { onOpenUrl(GitHubRepository.ISSUES_URL) }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import androidx.compose.foundation.layout.Spacer
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
Expand Down Expand Up @@ -312,6 +313,10 @@ private fun UpdateBar(
modifier =
Modifier.fillMaxWidth()
.background(colors.surfaceContainer)
// After the fill, before the padding: the container colour runs to the bottom edge
// of the window while the flash button stays clear of three-button navigation,
// which Scaffold leaves to its bottom slot rather than reserving itself.
.navigationBarsPadding()
.padding(horizontal = 16.dp, vertical = 12.dp)
) {
when (flash) {
Expand Down
Loading