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 timer of the elapsed recording time, formatted as `mm:ss`: counted up by the system from the content state's anchor when
/// one is given, and frozen at the reported elapsed time otherwise.
struct RecordingTimerText: View {
// MARK: Properties
/// The dynamic content of the Live Activity to render.
let state: RecordingActivityAttributes.ContentState
// MARK: Body
var body: some View {
if let anchor = state.anchor {
Text(
@@ -29,20 +29,20 @@ struct RecordingTimerText: View {
)
}
}
}
// MARK: - Helpers
private extension RecordingTimerText {
// MARK: Properties
/// The format of the timer: minutes and seconds, as `mm:ss`.
var timerFormat: Duration.TimeFormatStyle {
.time(pattern: .minuteSecond(padMinuteToLength: 2))
}
}
// MARK: - Previews