feat(components): let scrolling actions inherit the content inset
Pinned actions keep their own 24dp margin; scrolling ones sit inside the content column, so the caller's inset decides how wide they run.
This commit is contained in:
@@ -100,7 +100,13 @@ fun OnboardingScaffold(
|
||||
bottomBar = {
|
||||
// Pinned actions carry the navigation-bar inset themselves; scrolling
|
||||
// ones get it from the scaffold's own content padding.
|
||||
if (!scrollingActions) ActionsColumn(insetBottom = true, content = actions)
|
||||
if (!scrollingActions) {
|
||||
ActionsColumn(
|
||||
horizontalPadding = OnboardingSpace.md,
|
||||
insetBottom = true,
|
||||
content = actions,
|
||||
)
|
||||
}
|
||||
},
|
||||
) { innerPadding ->
|
||||
Column(
|
||||
@@ -115,7 +121,15 @@ fun OnboardingScaffold(
|
||||
hero()
|
||||
Spacer(Modifier.height(OnboardingSpace.lg))
|
||||
body()
|
||||
if (scrollingActions) ActionsColumn(insetBottom = false, content = actions)
|
||||
// No inset of its own: scrolling actions sit inside the content
|
||||
// column, so they line up with whatever is above them.
|
||||
if (scrollingActions) {
|
||||
ActionsColumn(
|
||||
horizontalPadding = 0.dp,
|
||||
insetBottom = false,
|
||||
content = actions,
|
||||
)
|
||||
}
|
||||
Spacer(Modifier.height(OnboardingSpace.md))
|
||||
}
|
||||
}
|
||||
@@ -124,6 +138,7 @@ fun OnboardingScaffold(
|
||||
/** The call-to-action stack, wherever the shell has put it. */
|
||||
@Composable
|
||||
private fun ActionsColumn(
|
||||
horizontalPadding: Dp,
|
||||
insetBottom: Boolean,
|
||||
content: @Composable ColumnScope.() -> Unit,
|
||||
) {
|
||||
@@ -131,7 +146,7 @@ private fun ActionsColumn(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.then(if (insetBottom) Modifier.navigationBarsPadding() else Modifier)
|
||||
.padding(horizontal = OnboardingSpace.md, vertical = OnboardingSpace.sm),
|
||||
.padding(horizontal = horizontalPadding, vertical = OnboardingSpace.sm),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
verticalArrangement = Arrangement.spacedBy(4.dp),
|
||||
content = content,
|
||||
|
||||
Reference in New Issue
Block a user