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

Socheat KHAUV

06/01/2020, 4:53 PM
AdapterList to display item in Vertically ?
v

Vinay Gaba

06/01/2020, 4:54 PM
Yeah right now it only supports vertical orientation but I expect support for horizontal in the future. It’s similar to RecyclerView in that it loads the items in a more efficient/performant manner. The VerticalScroller/HorizontalScroller are more similar to ScrollView than they are to RecyclerView.
in that they load all items eagerly
a

Adam Powell

06/01/2020, 6:03 PM
we've been having some discussions about how to best handle orientation and different layouts. At the moment I am of the opinion that they should be different composables and those should be as straightforward to write as static layouts are using the
Layout
composable, which would mean different vertical and horizontal list composables in a manner similar to
Row
and
Column
being distinct, as compared to
LinearLayout
with an orientation parameter
👍 2
Part of this is that more parameters force an implementation to become much more complex to deal with the combinatorics of options, which in turn makes it that much harder to add new options or to write a similar component with some small differences
to accomplish this we need to improve the API ergonomics around performing subcomposition of child items; as you can see from
AdapterList.kt
this is possible today but pretty raw
❤️ 1
a

Andrey Kulikov

06/01/2020, 6:08 PM
And yes, we do have plans to provide vertically scrolling Adapter List in the near future
v

Vinay Gaba

06/01/2020, 6:35 PM
I would vote for having a separate implementation for the orientation too and potentially renaming AdapterList to something else. It would make the API’s more consistent with the rest of the composables.
👍 2
2 Views