LiveActivityProviding
Adopt to show a compact live activity in the notch or island: small leading and trailing accessories beside the (simulated) notch, and an expanded surface on hover or tap.
@MainActor protocol LiveActivityProviding : Droplet
The host owns the presentation slot policy: publishing a state is a request, not a command, and a higher-priority activity (a phone call, a screen recording) can hold the slot.
A droplet that replaces a built-in feature (DroppyReplacesBuiltIn in its Info.plist) inherits that built-in's place in the host's precedence order rather than joining the generic droplet band at the bottom. That is declared in the manifest, not here: a claim to outrank the media chip is exactly the kind of thing that belongs in the file review reads, not in a number a droplet can raise at runtime.
- Note: Maturity: Stable. Covered by the 1.0 compatibility promise. Host support: the shipping Droppy reports your seat truthfully but does not award one to an external droplet yet, so today it is always
.none. Publish your state anyway. See Host support.
Properties
liveActivityState
@MainActor var liveActivityState: AnyPublisher<LiveActivityState?, Never> { get }
The droplet's current activity, or nil when idle. The host subscribes once at activation; publish on the main thread.
Methods
liveActivitySeatDidChange(_:)
@MainActor func liveActivitySeatDidChange(_ seat: DropletLiveActivitySeat)
The host moved this droplet's activity to a different seat (DroppyKit 0.6.0).
Publishing a state used to be a request into silence: a droplet could not tell whether it was on screen, riding the secondary pill, or losing to something it would never see. So it kept animating content nobody was looking at, and it had no honest answer when a user asked why the activity did not appear.
Use it to stop work, not to argue: there is no verb here for taking the seat back. A droplet that stops its ticker on none(_:) and restarts it on compact is doing exactly what this exists for.
liveActivitySeatDidChange(_:)
@MainActor func liveActivitySeatDidChange(_ seat: DropletLiveActivitySeat)
Default: ignore seat changes, which is what every droplet written against DroppyKit 0.5.0 and earlier already does.
makeCompactLeading()
@MainActor func makeCompactLeading() -> AnyView
Small view rendered on the leading side of the notch while the activity holds the compact slot.
makeCompactTrailing()
@MainActor func makeCompactTrailing() -> AnyView
Small view rendered on the trailing side of the notch while the activity holds the compact slot.
makeCompanionCompact(context:)
@MainActor func makeCompanionCompact(context: CompactLiveActivityContext) -> AnyView
The mark rendered inside the round companion pill while this activity rides the secondary seat beside another activity (DroppyKit 0.7.0).
Defaults to makeCompactLeading(), which is what the host mounted there before this verb existed. Implement it when the leading wing accessory does not read at puck scale: the context carries the resolved slot size.
makeCompanionCompact(context:)
@MainActor func makeCompanionCompact(context: CompactLiveActivityContext) -> AnyView
Default: the leading compact accessory, exactly what hosts mounted in the companion pill before DroppyKit 0.7.0.
makeCompanionDetail(context:)
@MainActor func makeCompanionDetail(context: LiveActivityContext) -> AnyView?
Detail content revealed when the user hovers the companion pill and the host grows it into a wide capsule (the accordion), or nil to keep the centered companion mark during the grow (DroppyKit 0.7.0).
The view is laid out leading-aligned beside the companion mark inside the grown capsule. Keep it to a line or two of text-scale content; the interactive surface remains makeExpanded(context:).
makeCompanionDetail(context:)
@MainActor func makeCompanionDetail(context: LiveActivityContext) -> AnyView?
Default: no accordion detail; the companion keeps its centered mark while the capsule grows.
makeExpanded(context:)
@MainActor func makeExpanded(context: LiveActivityContext) -> AnyView
The interactive surface shown when the user hovers or taps the compact activity. Read EnvironmentValues.dropletHUDLayout to clear the measured cutout and apply the host's resolved wing inset.