|
|
@@ -20,7 +20,7 @@ struct LiveActivity: Widget {
|
|
|
}
|
|
|
|
|
|
func updatedLabel(context: ActivityViewContext<LiveActivityAttributes>) -> Text {
|
|
|
- Text(dateFormatter.string(from: context.state.date))
|
|
|
+ Text("Updated: \(dateFormatter.string(from: context.state.date))")
|
|
|
}
|
|
|
|
|
|
func bgLabel(context: ActivityViewContext<LiveActivityAttributes>) -> Text {
|
|
|
@@ -77,7 +77,7 @@ struct LiveActivity: Widget {
|
|
|
ForEach(context.state.chart.indices, id: \.self) { index in
|
|
|
LineMark(
|
|
|
x: .value("Time", context.state.chartDate[index] ?? Date()),
|
|
|
- y: .value("Value", context.state.chart[index] ?? 0)
|
|
|
+ y: .value("Value", context.state.chart[index])
|
|
|
).foregroundStyle(Color.green.gradient).symbolSize(12)
|
|
|
}
|
|
|
}.chartPlotStyle { plotContent in
|
|
|
@@ -86,9 +86,6 @@ struct LiveActivity: Widget {
|
|
|
.chartYAxis {
|
|
|
AxisMarks(position: .leading)
|
|
|
}
|
|
|
- .chartXAxis {
|
|
|
- AxisMarks(position: .automatic)
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -98,9 +95,9 @@ struct LiveActivity: Widget {
|
|
|
|
|
|
HStack(spacing: 2) {
|
|
|
VStack {
|
|
|
- chart(context: context).frame(width: UIScreen.main.bounds.width / 1.7)
|
|
|
+ chart(context: context).frame(width: UIScreen.main.bounds.width / 1.8)
|
|
|
}.padding(.vertical, 5).padding(.horizontal, 15)
|
|
|
- Divider()
|
|
|
+ Divider().foregroundStyle(Color.white)
|
|
|
VStack {
|
|
|
ZStack {
|
|
|
bobble(context: context)
|
|
|
@@ -111,8 +108,8 @@ struct LiveActivity: Widget {
|
|
|
bgLabel(context: context).font(.title2).imageScale(.small)
|
|
|
changeLabel(context: context).font(.callout)
|
|
|
}
|
|
|
- }.padding(.trailing, 5).padding(.top, 5)
|
|
|
- updatedLabel(context: context).font(.caption).padding(.bottom)
|
|
|
+ }.padding(.trailing, 10).padding(.top, 5)
|
|
|
+ updatedLabel(context: context).font(.caption).padding(.bottom).padding(.trailing, 5)
|
|
|
}
|
|
|
}
|
|
|
.privacySensitive()
|
|
|
@@ -136,9 +133,10 @@ struct LiveActivity: Widget {
|
|
|
changeLabel(context: context).font(.title).padding(.trailing, 5)
|
|
|
}
|
|
|
DynamicIslandExpandedRegion(.bottom) {
|
|
|
+ chart(context: context)
|
|
|
+ }
|
|
|
+ DynamicIslandExpandedRegion(.center) {
|
|
|
updatedLabel(context: context).font(.caption).foregroundStyle(Color.secondary)
|
|
|
- .padding(.bottom, 5)
|
|
|
- chart(context: context).frame(height: 70)
|
|
|
}
|
|
|
} compactLeading: {
|
|
|
HStack(spacing: 1) {
|