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

Sinan Gunes

12/26/2020, 2:13 PM
How can I combine 2 or more LazyRow/LazyVerticalGrid calls? I am trying to create a gridlayout with sections. Without compose I used
ConcatAdapter
once and it was very easy.
d

Dominaezzz

12/26/2020, 2:27 PM
Use one
LazyRow
and call
items
twice?
s

Sinan Gunes

12/26/2020, 2:28 PM
I am trying to create a grid view with sections. result is like when I call items + item + items:
d

Dominaezzz

12/26/2020, 4:43 PM
Oh you want headers. Tricky.
s

Sinan Gunes

12/26/2020, 4:44 PM
yeah, I checked for size lookup for
LazyVerticalGrid
did not find anything related. probably I will need to dig it up in the source code.
d

Dominaezzz

12/26/2020, 4:47 PM
There's a ticket for sticky headers, can't seem to find it now. 😞
s

Sinan Gunes

12/26/2020, 4:48 PM
hmm, good to know. I will search tomorrow. thanks for notice.
k

Kshitij Patil

12/27/2020, 7:11 AM
What's your expected output?
s

Sinan Gunes

12/27/2020, 8:07 AM
in general section headers lay down between sections, separating them distinctly.
k

Kshitij Patil

12/27/2020, 9:43 AM
How about
Copy code
Column {
    LazyRow ( ) { ....}
    Text ( ) { ... } // Standard Text Composable
    LazyRow ( ) { ... }
}
If you need, you might use
ScrollableColumn
as root Composable
s

Sinan Gunes

12/27/2020, 9:58 AM
second Lazy Row is not rendered.
LazyRow inside ScrollableColumn gives another error about nested scrolls.
a

Andrey Kulikov

12/28/2020, 3:58 PM
we want to support spans count in the future so in LazyVerticalGrid you would be able to add an item which would take more than one span
for now you have to manually implement it with LazyColumn and emit rows with 3 elements or header
s

Sinan Gunes

12/28/2020, 4:48 PM
@Andrey Kulikov is there any open ticket for this, so maybe I can track/contribute ?
a

Andrey Kulikov

12/28/2020, 4:49 PM
no, I think we didn’t yet file a ticket for it. feel free to create
👍 1
🙏 1
@allan.conda ^^
a

allan.conda

01/14/2021, 1:08 PM
Thanks!!
👍 1
s

Sinan Gunes

02/01/2021, 12:07 PM
@Yasin Kaçmaz ^^
9 Views