0PricingLogin
Jetpack Compose Academy · Lesson

Drag, Swipe & Fling

Track movement and momentum.

Following the Finger

Dragging means tracking how far a finger moves and updating the UI to match. Compose makes this smooth with dedicated drag detectors. ✋

Detect Drag Gestures

Inside pointerInput, call detectDragGestures. Its onDrag lambda fires repeatedly with the change and the distance moved since the last event.

detectDragGestures { change, drag -> /* move */ }

All lessons in this course

  1. pointerInput & detectTapGestures
  2. Drag, Swipe & Fling
  3. Transform: Pan, Zoom & Rotate
  4. Nested Scroll Connections
← Back to Jetpack Compose Academy