https://kotlinlang.org logo
#compose
Title
# compose
a

allan.conda

06/15/2022, 3:15 PM
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

Colton Idle

06/15/2022, 11:31 PM
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

allan.conda

06/16/2022, 7:32 AM
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

Colton Idle

06/16/2022, 3:39 PM
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

allan.conda

06/16/2022, 3:42 PM
Well, I already have an app performance problem, so worried about anything that contributes to the slow down 😄
c

Colton Idle

06/16/2022, 4:02 PM
whats the profiler say about where your bottlenecks are?
a

allan.conda

06/16/2022, 5:58 PM
It doesn’t really give anything useful, just that that recompositions take a long time
2 Views