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