Refined the recording Live Activity presentation in the Widget target.

This commit is contained in:
2026-07-07 00:11:39 +02:00
parent 9e431c8e7a
commit dfd4829980
13 changed files with 281 additions and 163 deletions
@@ -5,14 +5,14 @@ import WidgetKit
/// The label naming the current state of the recording flow, next to an icon matching that state: a microphone while recording,
/// a pause symbol while paused, and a send symbol while the recorded input is being processed.
struct RecordingStateLabel: View {
// MARK: Properties
/// The dynamic content of the Live Activity to render.
let state: RecordingActivityAttributes.ContentState
// MARK: Body
var body: some View {
Label {
switch state.state {
@@ -24,21 +24,12 @@ struct RecordingStateLabel: View {
Text(.viewRecordingStateLabelStateProcessing)
}
} icon: {
switch state.state {
case .recording:
Image.Symbol.microphone
.foregroundStyle(.yellow)
case .paused:
Image.Symbol.pause
.foregroundStyle(.yellow)
case .processing:
Image.Symbol.send
.foregroundStyle(.green)
}
state.state.symbol
.foregroundStyle(state.state.tint)
}
.font(.body)
}
}
// MARK: - Previews