Skip to content

Instantly share code, notes, and snippets.

@Ahmed-Sellami
Created September 18, 2021 20:42
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/fb8e98a1d3f995787cc3fdb7d9bec11e to your computer and use it in GitHub Desktop.
Save Ahmed-Sellami/fb8e98a1d3f995787cc3fdb7d9bec11e to your computer and use it in GitHub Desktop.
@ExperimentalAnimationApi
@Composable
fun ShoesCard(shoesArticle: ShoesArticle, onDeleted: () -> Unit) {
/* ... */
val funnelWidth = radius * 3
val sideShapeWidth = funnelWidth + particleRadius * 2
val offsetX = remember { Animatable(0f) }
Box {
Canvas(/* ... */) { /* ... */ }
Canvas(/* ... */) { /* ... */ }
Box(Modifier
.padding(horizontal = 16.dp)
.swipeToDelete(offsetX, maximumWidth = sideShapeWidth) {
onDeleted()
}
) { /* ... */ }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment