Consider this composable nested layout: - LazyColumn(#1) ◦ Box (should not be a header) ◦ La...
i
Consider this composable nested layout: • LazyColumn(#1) ◦ Box (should not be a header) ◦ LazyColumn (#2) ▪︎ LazyRow ▪︎ Box Is there a way to scroll the LazyColumn #1 out of it’s bounds so that the LazyColumn #2 first item’s offset is positioned at (0dp, 40dp) from the screen’s top left origin? In Android leanback I used to use the WindowAlignement for that but I am wondering how can the same result be achieved using compose. Thanks
j
What is the point of LazyColumn inside LazyColumn? Why not just emit all elements in the LazyColumn#1?
👍 1
i
The box in LazyColum #2 may embed a grid. I can get rid of the nested lazy column and flatten more the structure but still if i just scroll the lazyColumn (parent) to the last position i wouldn’t have the last element topleft anschor aligned with the screens topleft one
j
ok, i'm not really sure what are you trying to achieve. If you want to take a height of LazyColumn#1 in LazyColumn#2 there is a
fillParentMaxHeight()
modifier, which will make the LazyColumn#2 the same height as the LazyColumn#1. But i'm not sure if that is what you are asking for
i
I already tried that but it wouldn’t align any child to the specific position i want unfortunately 😕 though I was able to have what I want using
Modifier.offset(…)
but on the child level. However this technique will not consider repositioning the other children of the parent LazyColumn
j
yea, i think offset isn't really a good fit with LazyColumn ;/
i
I think the way to go is define my own custom lazylayout. I will post an answer once done. Thanks @Jakub Syty
👍🏻 1
157 Views