Add this code to make drag animation resets smoother:
varoffsetXbyremember{mutableStateOf(0f)}valdraggableState=DraggableState{delta->offsetX+=delta}Box(modifier=Modifier.draggable(orientation=Orientation.Horizontal,state=draggableState,onDragStopped={draggableState.drag(MutatePriority.PreventUserInput){Animatable(offsetX).animateTo(targetValue=0f,tween(durationMillis=300)){dragBy(value-offsetX)}}})){//The Column is the item that will do the movingColumn(modifier=Modifier.offset{IntOffset(offsetX.roundToInt(),0)}){}}
Conclusion
Thank you for taking the time out of your day to read this blog post of mine. If you have any questions or concerns please comment below or reach out to me on Twitter.
We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.
Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.
Top comments (0)