Carta Operum

Journal ◆ Craft

A countdown ring for every round

Drawing the interval timer with a painter, and keeping it honest when the phone sleeps.

A HIIT session is a loop of rounds, and the whole screen is a ring that empties. It has to be readable at arm's length, from a mat, by someone out of breath. I draw it with a CustomPainter: a track, an arc, the round number in the middle and nothing else.

The painter is the easy half. The hard half is time. A timer that counts ticks drifts the moment the phone dims or the app is backgrounded, so the ring is a function of a start time and the clock, not of a counter. Each frame asks how far into the round we are and draws exactly that. If the app is suspended and returns mid-round, the ring is simply in the right place.

Sound and the haptic tick are kept apart from the drawing, so the last three seconds can buzz without the painter knowing. The ring is the one piece of Cadence I would extract into a package, because it has no opinions about workouts, only about time.