|
|
|
@ -16,6 +16,7 @@
|
|
|
|
|
|
|
|
|
|
package com.google.samples.apps.nowinandroid.ui
|
|
|
|
|
|
|
|
|
|
import androidx.compose.foundation.layout.Box
|
|
|
|
|
import androidx.compose.foundation.layout.Column
|
|
|
|
|
import androidx.compose.foundation.layout.Row
|
|
|
|
|
import androidx.compose.foundation.layout.WindowInsets
|
|
|
|
@ -199,6 +200,15 @@ internal fun NiaApp(
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Box(
|
|
|
|
|
modifier = if (shouldShowTopAppBar) {
|
|
|
|
|
Modifier.consumeWindowInsets(
|
|
|
|
|
WindowInsets.safeDrawing.only(WindowInsetsSides.Top),
|
|
|
|
|
)
|
|
|
|
|
} else {
|
|
|
|
|
Modifier
|
|
|
|
|
},
|
|
|
|
|
) {
|
|
|
|
|
NiaNavHost(
|
|
|
|
|
appState = appState,
|
|
|
|
|
onShowSnackbar = { message, action ->
|
|
|
|
@ -208,15 +218,9 @@ internal fun NiaApp(
|
|
|
|
|
duration = Short,
|
|
|
|
|
) == ActionPerformed
|
|
|
|
|
},
|
|
|
|
|
modifier = if (shouldShowTopAppBar) {
|
|
|
|
|
Modifier.consumeWindowInsets(
|
|
|
|
|
WindowInsets.safeDrawing.only(WindowInsetsSides.Top),
|
|
|
|
|
)
|
|
|
|
|
} else {
|
|
|
|
|
Modifier
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TODO: We may want to add padding or spacer when the snackbar is shown so that
|
|
|
|
|
// content doesn't display behind it.
|
|
|
|
|