Last active
September 24, 2022 11:46
-
-
Save mazzouzi/67133a11d931e337748d56f90aba4330 to your computer and use it in GitHub Desktop.
Header parallax effect
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
@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