Hi, Is there a way to get the value of the y posit...
# compose
p
Hi, Is there a way to get the value of the y position while the screen is scrolling? I have a situation like this:
Copy code
LazyColumn() {
    item {
      box()
      box()
      box()
      ScrollableTabRow()
    }
    itemsIndexed {...}
I need to know when the ScrollableTabRow moves past a certain position on y axis (for example lets say 100.dp ) I tried working with .scrollable() (something like scrollable) and with scroll gesture filter (something like gesture) and with dragGestureFilter but i cannot get it to work, am i doing something wrong, or is it just not possible?
a
do you just need to know when
ScrollableTabRow
is not visible anymore or something more complex?
p
yup, when its not visible will be fine for my issue
a
Copy code
LazyColumn() {
    item {
      box()
      box()
      box()
    }
    item {
      ScrollableTabRow()
      DisposableEffect(Unit) {
          onDispose {
             // do something when ScrollableTabRow is not visible anymore
          }
      }
    }
    itemsIndexed {...}
p
@Andrey Kulikov I checked out the solution you provided but i think, that wont work for my case. Basically what i need to do is for the scrollable tab row to act as sticky header after it touches top of the screen. I know that i think on the next version of compose You guys will provide something like that, but is there some workaround to use for now? What i wanted to do is, after scrollable row touches top of the screen, create some sort of mockup for it at the top of the screen, but maybe there is some easier way?
a
the sticky header support in LazyColumn should be released this wednesday. if you don’t want to wait you can always use snapshots of the current version: https://androidx.dev/
r
Are the sticky headers now officially supported in
alpha-10
?