Final Project: Build an Animated Loading Spinner
Time to combine shapes, animated values, transforms, and gestures into one real piece of UI: a custom animated loading spinner.
Requirements
- Render at least two Skia shapes inside a single
Canvas(for example an outer ring built from a strokedCircleand an inner accent shape). - Drive a continuous rotation using a
useValueandrunTiming, looping forever (re-triggering the animation each time it completes, as shown in the transforms lesson). - Animate at least one more property besides rotation, radius, opacity, or color, using
useComputedValueto derive it from your rotation value. - Add a tappable/draggable element (even a simple
GestureDetectorwrapping the wholeCanvas) that triggers arunSpringanimation, a "pulse" on tap is enough. - Wrap the whole thing in a reusable
<Spinner />component that accepts asizeprop and works at any size.
Stretch goals
- Add a second, independent ring rotating in the opposite direction at a different speed.
- Fade the spinner in with
runTimingon an opacity value when it first mounts. - Turn it into a progress ring: accept a
progressprop (0-1) and animate the stroke's arc length to match instead of spinning forever.
Submit a link to your finished project (a repo or gist) below, an instructor will review it before you can mark this lesson complete. Good luck!