Refined the recording Live Activity presentation in the Widget target.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user