-
-
Save arcadefire/921f8b13ffafcfd84800ff0818592440 to your computer and use it in GitHub Desktop.
Pre and post fling
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override suspend fun onPreFling(available: Velocity): Velocity { | |
return if (available.y < 0 && scrollState.value == 0) { | |
swipeableState.performFling(available.y) | |
available | |
} else { | |
Velocity.Zero | |
} | |
} | |
override suspend fun onPostFling( | |
consumed: Velocity, | |
available: Velocity | |
): Velocity { | |
swipeableState.performFling(velocity = available.y) | |
return super.onPostFling(consumed, available) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment