Skip to content

Instantly share code, notes, and snippets.

@arcadefire
Created September 12, 2021 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arcadefire/f4c77fad4bc8b39724a2871acdd536b7 to your computer and use it in GitHub Desktop.
Save arcadefire/f4c77fad4bc8b39724a2871acdd536b7 to your computer and use it in GitHub Desktop.
Pre-scroll
override fun onPreScroll(
available: Offset,
source: NestedScrollSource
): Offset {
val delta = available.y
return if (delta < 0) {
swipeableState.performDrag(delta).toOffset()
} else {
Offset.Zero
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment