hukumister / lazycardstack Goto Github PK
View Code? Open in Web Editor NEWTinder like card stack for compose
Tinder like card stack for compose
It seems the CardStack holds the last item. Is there any other way of handling the last item?
Hi. I use your project in the Kotlin Multiplatform project Android, iOS and Desktop, but it will support WASM, too. Would you like me to create a PR for your repo to enable KMP support? Ofc you will need to update your Maven publish pipeline to publish KMP artefacts.
Hi, when I add library as module in my project, I am getting Offset is unspecified
.
Exception dispatching input event.
Exception in MessageQueue callback: handleReceiveCallback
java.lang.IllegalStateException: Offset is unspecified
at androidx.compose.ui.geometry.InlineClassHelperKt.throwIllegalStateException(InlineClassHelper.kt:35)
at androidx.compose.ui.geometry.OffsetKt.isFinite-k-4lQ0M(Offset.kt:364)
at androidx.compose.ui.node.NodeCoordinator.withinLayerBounds-k-4lQ0M(NodeCoordinator.kt:1036)
at androidx.compose.ui.node.NodeCoordinator.hitTest-YqVAtuI(NodeCoordinator.kt:522)
at androidx.compose.ui.node.LayoutNode.hitTest-M_7yMNQ$ui_release(LayoutNode.kt:986)
at androidx.compose.ui.node.NodeCoordinator$Companion$PointerInputSource$1.childHitTest-YqVAtuI(NodeCoordinator.kt:1267)
at androidx.compose.ui.node.InnerNodeCoordinator.hitTestChild-YqVAtuI(InnerNodeCoordinator.kt:220)
at androidx.compose.ui.node.NodeCoordinator.hitTest-YqVAtuI(NodeCoordinator.kt:542)
at androidx.compose.ui.node.NodeCoordinator.hitTestChild-YqVAtuI(NodeCoordinator.kt:694)
at androidx.compose.ui.node.NodeCoordinator.hit-1hIXUjU(NodeCoordinator.kt:594)
at androidx.compose.ui.node.NodeCoordinator.access$hit-1hIXUjU(NodeCoordinator.kt:57)
at androidx.compose.ui.node.NodeCoordinator$hit$1.invoke(NodeCoordinator.kt:598)
at androidx.compose.ui.node.NodeCoordinator$hit$1.invoke(NodeCoordinator.kt:596)
at androidx.compose.ui.node.HitTestResult.hitInMinimumTouchTarget(HitTestResult.kt:117)
at androidx.compose.ui.node.HitTestResult.hit(HitTestResult.kt:97)
at androidx.compose.ui.node.NodeCoordinator.hit-1hIXUjU(NodeCoordinator.kt:596)
at androidx.compose.ui.node.NodeCoordinator.hitTest-YqVAtuI(NodeCoordinator.kt:545)
at androidx.compose.ui.node.LayoutNode.hitTest-M_7yMNQ$ui_release(LayoutNode.kt:986)
at androidx.compose.ui.node.NodeCoordinator$Companion$PointerInputSource$1.childHitTest-YqVAtuI(NodeCoordinator.kt:1267)
at androidx.compose.ui.node.InnerNodeCoordinator.hitTestChild-YqVAtuI(InnerNodeCoordinator.kt:220)
at androidx.compose.ui.node.NodeCoordinator.hitTest-YqVAtuI(NodeCoordinator.kt:542)
at androidx.compose.ui.node.NodeCoordinator.hitTestChild-YqVAtuI(NodeCoordinator.kt:694)
at androidx.compose.ui.node.NodeCoordinator.hitTest-YqVAtuI(NodeCoordinator.kt:542)
at androidx.compose.ui.node.NodeCoordinator.hitTestChild-YqVAtuI(NodeCoordinator.kt:694)
at androidx.compose.ui.node.NodeCoordinator.hitTest-YqVAtuI(NodeCoordinator.kt:542)
at androidx.compose.ui.node.LayoutNode.hitTest-M_7yMNQ$ui_release(LayoutNode.kt:986)
at androidx.compose.ui.node.NodeCoordinator$Companion$PointerInputSource$1.childHitTest-YqVAtuI(NodeCoordinator.kt:1267)
at androidx.compose.ui.node.InnerNodeCoordinator.hitTestChild-YqVAtuI(InnerNodeCoordinator.kt:220)
at androidx.compose.ui.node.NodeCoordinator.hitTest-YqVAtuI(NodeCoordinator.kt:542)
at androidx.compose.ui.node.NodeCoordinator.hitTestChild-YqVAtuI(NodeCoordinator.kt:694)
at androidx.compose.ui.node.NodeCoordinator.hitTest-YqVAtuI(NodeCoordinator.kt:542)
at androidx.compose.ui.node.NodeCoordinator.hitTestChild-YqVAtuI(NodeCoordinator.kt:694)
at androidx.compose.ui.node.NodeCoordinator.hitTest-YqVAtuI(NodeCoordinator.kt:542)
at androidx.compose.ui.node.NodeCoordinator.hitTestChild-YqVAtuI(NodeCoordinator.kt:694)
at androidx.compose.ui.node.NodeCoordinator.hitTest-YqVAtuI(NodeCoordinator.kt:542)
at androidx.compose.ui.node.LayoutNode.hitTest-M_7yMNQ$ui_release(LayoutNode.kt:986)
at androidx.compose.ui.node.NodeCoordinator$Companion$PointerInputSource$1.childHitTest-YqVAtuI(NodeCoordinator.kt:1267)
at androidx.compose.ui.node.InnerNodeCoordinator.hitTestChild-YqVAtuI(InnerNodeCoordinator.kt:220)
I'm trying to display a swipe indicator once the swipe reaches a threshold. This code works, but it makes the swiping really unresponsive. Is there a better way to achieve this?
val cardStackState = rememberLazyCardStackState()
val showSwipeIndicator by remember {
derivedStateOf {
cardStackState.offset.x > 200
}
}
I want to show upcoming cards shadow like tinder , where current stack top also shows upcomng cards. For reference you can see attached screenshot.
[https://drive.google.com/file/d/1j5zF9KAipJhYMsaAFv3zO2y4h7oGAvno/view?usp=sharing](required feature's screenshot)
I have a list item with "selected" field.
After modifying a list like this:
list.map { item -> if(needToSelect) item.copy(selected = true) else item }
current index of card is reset, but I want to modify only selected item.
When trying to swipe the last item it always snaps back to center. Is this intended behaviour?
Hi, what is the reason behind the min version being 24?? incompatibilities?? and how can i detect theres 5 item left in the list (for example) and add more items without losing the remaining items state?? Cool library!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.