Created
March 16, 2021 19:01
-
-
Save pauloaapereira/d40ef1888d78f447dc12ea372ea41508 to your computer and use it in GitHub Desktop.
Jetpack Compose - Pendulum Effect - 2
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 | |
fun Pendulum( | |
modifier: Modifier = Modifier, | |
startX: Float = .2f, | |
endX: Float = .8f, | |
topY: Float = .2f, | |
bottomY: Float = .4f, | |
... | |
) { | |
val infiniteTransition = rememberInfiniteTransition() | |
BoxWithConstraints( | |
modifier = modifier | |
) { | |
val start = maxWidth * startX | |
val end = maxWidth * endX | |
val top = maxHeight * topY | |
val bottom = maxHeight * bottomY | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment