Use swipeable cards like Tinder Cards in Jetpack Compose. This project was originally forked from DavideC00 and changed to support the latest compose version and be more generic.
Add the maven repo to your root build.gradle (If you haven't already)
allprojects {
repositories {
jcenter()
}
}Add the dependency:
dependencies {
implementation 'com.luminarlab.ui:compose-cardstack:{latest_version}'
}A simple use case
//EmptyStack() and CardContent() are custom composables and not included in the library
CardStack(
modifier = Modifier,
items = items,
empty = {
EmptyStack()
},
buttons = {
CardStackButtons()
}
) { item, index ->
SwipeableCard(index = index) {
CardContent(item = item)
}
}See more in the example app
Any contribution is appreciated
