This guide explains the basic features of CardStackView: Swipe, Rewind, and Cancel.
Users can swipe cards by dragging in the configured direction:
Swipe directions are configured via setDirections():
manager.setDirections(Direction.HORIZONTAL) // Left/Right
manager.setDirections(Direction.VERTICAL) // Top/Bottom
manager.setDirections(Direction.FREEDOM) // All directionsYou can swipe cards programmatically:
cardStackView.swipe()You can customize the swipe animation:
val setting = SwipeAnimationSetting.Builder()
.setDirection(Direction.Right)
.setDuration(Duration.Normal.duration)
.setInterpolator(AccelerateInterpolator())
.build()
manager.setSwipeAnimationSetting(setting)
cardStackView.swipe()See Custom Animations for more details.
If a card is dragged less than the configured threshold, the swipe is canceled and the card springs back:
The threshold is configured via setSwipeThreshold():
manager.setSwipeThreshold(0.3f) // 30% - DefaultSee Configuration for more details.
Rewind brings back the last swiped card:
cardStackView.rewind()You can customize the rewind animation:
val setting = RewindAnimationSetting.Builder()
.setDirection(Direction.Bottom)
.setDuration(Duration.Normal.duration)
.setInterpolator(DecelerateInterpolator())
.build()
manager.setRewindAnimationSetting(setting)
cardStackView.rewind()See Custom Animations for more details.
You can also configure gestures for rewind. See Advanced Features.
You can control how swiping can be performed:
manager.setSwipeableMethod(SwipeableMethod.AutomaticAndManual) // Both
manager.setSwipeableMethod(SwipeableMethod.Automatic) // Code only
manager.setSwipeableMethod(SwipeableMethod.Manual) // Gestures only
manager.setSwipeableMethod(SwipeableMethod.None) // DisabledSee Configuration for more details.
- Callbacks - React to swipe events
- Custom Animations - Customize animations
- Overlay Views - Add Like/Dislike indicators



