Skip to content

Instantly share code, notes, and snippets.

@pauloaapereira
Created March 16, 2021 19:01
Show Gist options
  • Save pauloaapereira/d40ef1888d78f447dc12ea372ea41508 to your computer and use it in GitHub Desktop.
Save pauloaapereira/d40ef1888d78f447dc12ea372ea41508 to your computer and use it in GitHub Desktop.
Jetpack Compose - Pendulum Effect - 2
@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