mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-08-03 12:37:15 -04:00
Update dynamic island
This commit is contained in:
parent
e84deb1360
commit
41992a810d
@ -63,28 +63,35 @@ struct DownloadsLiveActivity: Widget {
|
||||
DynamicIsland {
|
||||
// Expanded UI
|
||||
DynamicIslandExpandedRegion(.leading) {
|
||||
Spacer()
|
||||
KiwixLogo(maxHeight: 50)
|
||||
Spacer()
|
||||
}
|
||||
DynamicIslandExpandedRegion(.trailing) {
|
||||
ProgressView(value: context.state.progress)
|
||||
.progressViewStyle(CircularProgressGaugeStyle(lineWidth: 11.4))
|
||||
.padding(6.0)
|
||||
}
|
||||
DynamicIslandExpandedRegion(.center) {
|
||||
let timeInterval = startTime...Date(
|
||||
timeInterval: context.state.estimatedTimeLeft,
|
||||
since: .now
|
||||
)
|
||||
VStack(alignment: .leading) {
|
||||
Text(context.state.title)
|
||||
.lineLimit(1)
|
||||
.multilineTextAlignment(.leading)
|
||||
.font(.headline)
|
||||
.bold()
|
||||
Text(context.state.progressDescription)
|
||||
.lineLimit(1)
|
||||
.multilineTextAlignment(.leading)
|
||||
.font(.caption)
|
||||
.tint(.secondary)
|
||||
ProgressView(timerInterval: timeInterval, countsDown: false, label: {
|
||||
Text(context.state.progressDescription)
|
||||
.lineLimit(1)
|
||||
.font(.caption)
|
||||
.tint(.secondary)
|
||||
}, currentValueLabel: {
|
||||
Text(timerInterval: timeInterval)
|
||||
.font(.caption)
|
||||
.tint(.secondary)
|
||||
})
|
||||
.tint(Color.primary)
|
||||
}
|
||||
.padding(.leading)
|
||||
.dynamicIsland(verticalPlacement: .belowIfTooWide)
|
||||
}
|
||||
|
||||
DynamicIslandExpandedRegion(.trailing) {
|
||||
KiwixLogo(maxHeight: 50)
|
||||
.padding()
|
||||
}
|
||||
} compactLeading: {
|
||||
KiwixLogo()
|
||||
|
Loading…
x
Reference in New Issue
Block a user