feat: route all Live Activity island taps through Tap station action
Expanded leading/trailing, compact and minimal island views had no Link, so tapping them just opened the app with no destination. Every island region now links to the same tap destination as the Lock Screen card (Maps vs in-app detail). Tap hint captions follow the setting too: Tap for details vs Tap for directions.
This commit is contained in:
@@ -32,22 +32,32 @@ struct FuelBoardLiveActivity: Widget {
|
||||
} dynamicIsland: { context in
|
||||
DynamicIsland {
|
||||
DynamicIslandExpandedRegion(.leading) {
|
||||
FuelBoardLiveActivityCompactView(context: context)
|
||||
Link(destination: FuelBoardLiveActivityTap.tapDestination(for: context.state)) {
|
||||
FuelBoardLiveActivityCompactView(context: context)
|
||||
}
|
||||
}
|
||||
DynamicIslandExpandedRegion(.trailing) {
|
||||
FuelBoardLiveActivityPriceView(context: context)
|
||||
Link(destination: FuelBoardLiveActivityTap.tapDestination(for: context.state)) {
|
||||
FuelBoardLiveActivityPriceView(context: context)
|
||||
}
|
||||
}
|
||||
DynamicIslandExpandedRegion(.bottom) {
|
||||
FuelBoardLiveActivityStationView(context: context)
|
||||
}
|
||||
} compactLeading: {
|
||||
Image(systemName: "fuelpump.fill")
|
||||
.foregroundStyle(context.state.fuel.tintColor)
|
||||
Link(destination: FuelBoardLiveActivityTap.tapDestination(for: context.state)) {
|
||||
Image(systemName: "fuelpump.fill")
|
||||
.foregroundStyle(context.state.fuel.tintColor)
|
||||
}
|
||||
} compactTrailing: {
|
||||
FuelBoardLiveActivityPriceView(context: context)
|
||||
Link(destination: FuelBoardLiveActivityTap.tapDestination(for: context.state)) {
|
||||
FuelBoardLiveActivityPriceView(context: context)
|
||||
}
|
||||
} minimal: {
|
||||
Text(context.state.priceText)
|
||||
.font(.caption2.bold().monospacedDigit())
|
||||
Link(destination: FuelBoardLiveActivityTap.tapDestination(for: context.state)) {
|
||||
Text(context.state.priceText)
|
||||
.font(.caption2.bold().monospacedDigit())
|
||||
}
|
||||
}
|
||||
}
|
||||
.supplementalActivityFamilies([.small])
|
||||
@@ -139,7 +149,8 @@ private struct FuelBoardLiveActivityView: View {
|
||||
FuelStore.priceTextAttributed(context.state.pricePence,
|
||||
style: context.state.priceDisplayStyle,
|
||||
size: 22, weight: .bold)
|
||||
Text("Tap for directions")
|
||||
Text(FuelStore.loadStationTapAction() == .showDetails
|
||||
? "Tap for details" : "Tap for directions")
|
||||
.font(.caption2)
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user