Hey guys, does anyone know how to handle nested sw...
# compose
y
Hey guys, does anyone know how to handle nested swipeable?
j
Do you have a more specific question, bug or some code? 🙂
y
Originally intended to make the parent
composable
and child
composable
independent of each other to use their own
SwipeableState
but with same direction, and that way the child one always win the competition as that is designed to, so i wandered may have some kind of
nestedScroll
api to solve the problem. at last, i realized both parent and child can use a same
SwipeableState
, but need to do some extra math work.
s
You say "solve the problem" but I don't think you've explained what the problem is. So the child wins the competition, but what is it that you wanted to happen instead?
y
what i want is when child reached the anchor edge (means it can not swipe further any more in current direction), the parent can take over.
I think the question is clear enough, as compose have the auto nested scrolling feature: https://developer.android.com/jetpack/compose/gestures#auto-nested-scrolling so how do we handle for the similar situation in dragging and swiping?