What’s the simplest way to declare a layout with a...
# compose
a
What’s the simplest way to declare a layout with a header and a footer? Scaffold is simple but I heard it’s expensive to use.
c
Really? I haven't heard that before. My app uses a bunch of nested scaffolds with noticeable issues. /shruggie If you need something similar, then I supposed you could do a Box, or a column. Box{ Top(align(Top)) Center(fillMaxSize) Bottom(align(Bottom)) } or Column{ Top() Center(weight(1f)) Bottom() }
a
I heard it once and never forgot about it 😄 because we are using a lot of Scaffold https://kotlinlang.slack.com/archives/CJLTWPH7S/p1645748219255089?thread_ts=1645552485.247699&cid=CJLTWPH7S
👍 1
Box are on top of each other, you’d have to know the sizes of top and bottom I think. Column… not sure that works for a scrollable center content 🤔 maybe
c
I use scaffold a lot because since I draw edge to edge I like to have the contentPadding arg passed to my content.
and yeah. i def use scaffold inside of scaffolds a bunch. i wouldn't worry about it too much, but yeah like ian said. you can probably go to a column first to see if that works for you.
i can confirm that you can def do this with a box, or column though because i do this throughout my 3 apps depending on different requirements.
👍 1
a
Well, I already have an app performance problem, so worried about anything that contributes to the slow down 😄
c
whats the profiler say about where your bottlenecks are?
a
It doesn’t really give anything useful, just that that recompositions take a long time