Gesture-Driven Animations
Drive motion from drags and swipes.
Motion You Control by Touch
State-driven animations run on their own, but some motion should follow your finger. Gesture-driven animations let drags and swipes steer the movement. ✨
Track the Offset
Hold the current position in state. The most direct tool is the Animatable, which stores a value and can both jump and animate to it.
val offsetX = remember { Animatable(0f) }