Consider this composable nested layout: - LazyColu...
# compose
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
k
Don't use nested scrollable containers
m
Nested scrolling containers generally lead to bad user experience, as the multiple scrolls presents issues for detecting what you are trying to scroll, and that translates to the user having trouble. This is not something unique to compose either. It applies to the xml world as well
i
I am aware of this issue however the UX is requesting that the main page container should be scrollable and also embed a lazyVerticalGrid.
k
UX should not be dictating the implementation details. They should also not push for using something that is going to be a bad user experience
i
could the following be a solution: • LazyGridView ◦ Box (Header) Span =1 ◦ items (span = 4) I think in this way the UI will be flat as using only one scrollable container as root