Ryan Simon
06/14/2021, 3:41 AMScaffold
to a child Composable
isn’t very obvious
More info in the thread…Ryan Simon
06/14/2021, 3:43 AMScaffold
to anything that’s wrapped by the Scaffold
.
Now technically I could do this using CompositionLocal
, and I considered it, but I’m wondering if anyone else has ideas.
I’ve attached some relevant code. You’ll notice that the Scaffold
wraps a nav graph and my intention is to have all the content be padded properly. The thing is I end up with clipping if I add the padding to Box
that surrounds my nav graph contentRyan Simon
06/14/2021, 3:44 AMIan Lake
06/14/2021, 3:51 AMBox
does no clipping, so it sounds like something else is going on. Note that NavHost
takes Modifiers itself, so you could just pass the padding through to itRyan Simon
06/14/2021, 3:55 AMScaffold
. that way there’s no visible clipping of the content during scrollRyan Simon
06/14/2021, 3:56 AMcontentPadding
parameter of my LazyColumn
, but that approach breaks down a bit when using this kind of navigation setupIan Lake
06/14/2021, 3:57 AMNavHost
, you want to specifically apply padding directly to your scrolling viewRyan Simon
06/14/2021, 3:57 AMRyan Simon
06/14/2021, 3:58 AMRyan Simon
06/14/2021, 3:58 AMIan Lake
06/14/2021, 3:59 AMModifier.statusBarsPadding()
, etc. on the items you want?Ryan Simon
06/14/2021, 4:00 AMScaffold
adds for the top and bottom bars that is needed beyond the status barsRyan Simon
06/14/2021, 4:02 AMinsets-ui
Scaffold
Ian Lake
06/14/2021, 4:04 AMTopAppBar
always above your content and a BottomNavigation
below your content, when is your content ever going to be overlapping the status bar or navigation bar? It'll always be in between the two other parts of your Scaffold
Ian Lake
06/14/2021, 4:06 AMRyan Simon
06/14/2021, 4:11 AMIan Lake
06/14/2021, 4:11 AMIf you're using VerticalScroller, apply this [PaddingValues] modifier to the child of the scroller, and not on the scroller itself.
Ryan Simon
06/14/2021, 4:12 AMIan Lake
06/14/2021, 4:13 AMRyan Simon
06/14/2021, 4:13 AMRyan Simon
06/14/2021, 4:13 AMIan Lake
06/14/2021, 4:14 AMRyan Simon
06/14/2021, 4:14 AMRyan Simon
06/14/2021, 4:14 AMRyan Simon
06/14/2021, 4:15 AMRyan Simon
06/14/2021, 4:16 AMIan Lake
06/14/2021, 4:16 AMIan Lake
06/14/2021, 4:16 AMIan Lake
06/14/2021, 4:16 AMRyan Simon
06/14/2021, 4:16 AMRyan Simon
06/14/2021, 4:17 AMIan Lake
06/14/2021, 4:17 AMRyan Simon
06/14/2021, 4:17 AM