Roar Gronmo
12/07/2019, 3:46 PMAdam Powell
12/07/2019, 5:05 PMScrollerPosition
hoisted state object, its value
property is backed by @Model
and reading it will trigger recomposition as neededColumn {
val pos = +memo { ScrollerPosition() }
Text("position: ${pos.value}")
VerticalScroller(pos) {
// content
(note: slow because it recomposes both the text and scroller per frame there and there's still a bunch of missing optimizations in this path; if you stick the text in a fixed size container it's much less so)Roar Gronmo
12/08/2019, 8:32 AMAdam Powell
12/08/2019, 2:24 PMVerticalScroller
as it's meant to be the ScrollView
analog for smaller/less dynamic content. The `ListView`/`RecyclerView` analog is WIP at the moment and definitely will.VerticalScroller
today, you should have everything you need. Something like
val ScrollerPosition.isAtEndOfList: Boolean get() = value >= maxPosition - range
should do the trickVerticalScroller
composes its entire content body though, and given that you're also asking questions about integrating with database queries it's not intended to be the heavily scalable component for this sort of thing 🙂