Module live_activity
Expand description
What an app keeps going outside its own window: a running timer, a call, a route, a song, a picture in a picture.
An app describes its activity as a Summary: a title, the value it reads
(a countdown, an elapsed time, who is on the line), how far along it is, up
to three controls and a tone. The session draws that one shape as the bar’s
pill and as a floating card, so the two never disagree and neither has to
know what the activity is. Rich bodies (a call’s video, a live route) are
drawn by their app inside the card frame; the summary is still what names,
prioritises and closes them.
The summary crosses from an app to the session as JSON, so every field is optional but the title and kind: an older app’s activity still shows.
Structs§
- Announcement
- A timer or an alarm that came due, said as a notification.
- Control
- One control the activity offers.
- Published
- What an app publishes on the live activity board: the activity it keeps going, and an announcement it wants made.
- Summary
- One activity, as the bar’s pill and the floating layer draw it.
Enums§
- Art
- How an activity’s artwork heads its card.
- Control
Kind - What pressing a control does, as the card draws it.
- Kind
- What an activity is. It decides where the activity sits in the bar’s pill and whether it wants a card of its own.
- Tone
- How loudly an activity reads: its glyph on the card, its reading in the pill.
Constants§
- MAX_
CONTROLS - The most controls a summary names: what fits a card’s row, and what the bar’s pill and keyboard reach. A song names three (previous, play or pause, next) beside the close its card’s header carries.