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

Roberto Leinardi

02/22/2024, 9:35 AM
I'm in the process of adding nested scroll capabilities to a custom
LazyLayout
that behaves like a table, scrolling in both directions. I've got the
TopAppBar
collapsing smoothly with
enterAlwaysScrollBehavior
when I scroll the table vertically using the
NestedScrollDispatcher
. However, I've hit a snag: when I switch over to a
LazyColumn
, the
TopAppBar
either snaps back open or collapses entirely after reaching a certain point. Oddly enough, this behavior doesn't occur with my implementation. Not quite sure what's causing it. At the moment, I'm using
NestedScrollDispatcher.dispatchPreScroll()
and
NestedScrollDispatcher.dispatchPostScroll()
. I'm wondering if I've made a mistake with these dispatchers or if there's something else I should be implementing, like `dispatchPreFling`/`dispatchPostFling`, to get things working smoothly?
4 Views