Skip to content

Instantly share code, notes, and snippets.

@Ahmed-Sellami
Last active September 19, 2021 14:10
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 Ahmed-Sellami/c60bbcfb070f80b69f7c1da54c37b6f9 to your computer and use it in GitHub Desktop.
Save Ahmed-Sellami/c60bbcfb070f80b69f7c1da54c37b6f9 to your computer and use it in GitHub Desktop.
val funnelInitialTranslation = -funnelWidth - particleRadius
val funnelTranslation = remember { mutableStateOf(funnelInitialTranslation) }
funnelTranslation.value = (offsetX.value + funnelInitialTranslation).negateIfPositive()
Box {
Canvas(
Modifier.height(itemHeightDp)
) {
translate(funnelTranslation.value) {
/* Funnel */
}
translate(offsetX.value - particleRadius) {
/* Circle */
}
}
/* ... */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment