Skip to content

Instantly share code, notes, and snippets.

@mazzouzi
Last active September 24, 2022 11:46
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 mazzouzi/67133a11d931e337748d56f90aba4330 to your computer and use it in GitHub Desktop.
Save mazzouzi/67133a11d931e337748d56f90aba4330 to your computer and use it in GitHub Desktop.
Header parallax effect
@Composable
private fun Header(scroll: ScrollState, headerHeightPx: Float) {
Box(modifier = Modifier
.fillMaxWidth()
.height(headerHeight)
.graphicsLayer {
translationY = -scroll.value.toFloat() / 2f // Parallax effect
}
)
.
.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment