The Curious Case of Android Gesture Animation
summary
Implements a stretchy, sticky square that snaps to top or bottom using ViewDragHelper with clampViewPositionVertical and settleCapturedViewAt for smooth settling; Android drag‑and‑drop is rejected because it only shows a drag shadow. Uses spring/dynamic animations (androidx.core.animation or ObjectAnimator/AnimatorSet) to restore scale, y offset and a stretch factor; Jetpack Compose version uses rememberDraggableState, draggable modifier and updateTransition and cuts the imperative touch plumbing to about five lines while preserving the bounce and fixing flicker.
AI-written summary · about
chapters (14)
- 0:00Introduction and overview
- 1:51Stretchable square setup
- 2:56Android drag and drop framework
- 5:02View drag helper implementation
- 7:12Jetpack Compose dragable basics
- 8:17Smooth settling with settle capture
- 9:19Making the square stretchable
- 10:21Stuck and unstuck states
- 12:28Flipping and dynamic animation
- 13:32Fixing flip at bottom
- 14:14Dynamic animation basics
- 15:16Spring animation for bounce
- 16:20Jetpack Compose update transition
- 18:55Comparison and summary
related talks
24mI Want Drag & Drop on Android Too!
32mThe Gesture Animations Dance
34mHandle gestures and touch events for CustomView
32mPractical Magic with Animations in Compose
36mPractical Magic with Animations in Compose
20mAdvanced Android Touches
21mAnimations with Jetpack Compose
32mTap it! Shake it! Fling it! Sheep it!
