Last active
February 12, 2024 08:09
-
-
Save Levi-Moreira/98bac839b25db5853fd8257abaa1990d to your computer and use it in GitHub Desktop.
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 fun onPreScroll(available: Offset, source: NestedScrollSource): Offset { | |
val delta = available.y.toInt() | |
val newOffset = appBarOffset + delta | |
val previousOffset = appBarOffset | |
appBarOffset = newOffset.coerceIn(-appBarMaxHeight, 0) | |
val consumed = appBarOffset - previousOffset | |
return Offset(0f, consumed.toFloat()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment