0Pricing
Jetpack Compose Academy · Lesson

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) }

All lessons in this course

  1. animate*AsState for Simple Tweens
  2. AnimatedVisibility & Crossfade
  3. updateTransition for Coordinated Motion
  4. Gesture-Driven Animations
← Back to Jetpack Compose Academy