mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
* Remove non functional module override button * Remove stale keys * Onboarding and lora config bug fixes * Add Annotations view and try and simplify online annimations to improve performance. * Bump version * Fix proto bug * Don't show ignored nodes on the mesh map * More node annotation animation improvements * Ham * Remove liquid glass form icon * Update MQTT config logic * Liquid glass chirpy and ham on the watch * Use Hops away value for DM's (#1409) * Set hopLimit for DM messages (DM's and Exchange position) to the hops away value for the node you are sending to. * Update Meshtastic/Accessory/Accessory Manager/AccessoryManager+ToRadio.swift Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update Icons * 🐰 * DataDog action logging (#1411) Co-authored-by: Jake-B <jake-b@users.noreply.github.com> * Update location usage details * Good doggo (#1414) * DataDog action logging * Filter version hash --------- Co-authored-by: Jake-B <jake-b@users.noreply.github.com> * Update Meshtastic/Views/Nodes/Helpers/Map/MapContent/MeshMapContent.swift Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update Meshtastic/Helpers/LocationsHandler.swift Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update Meshtastic/Views/Settings/Config/Module/MQTTConfig.swift Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update Meshtastic/Views/Nodes/Helpers/Map/MapContent/AnimatedNodePin.swift Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: jake-b <1012393+jake-b@users.noreply.github.com> Co-authored-by: Jake-B <jake-b@users.noreply.github.com>
70 lines
2 KiB
Swift
70 lines
2 KiB
Swift
import SwiftUI
|
|
import MapKit
|
|
import CoreLocation
|
|
|
|
struct AnimatedNodePin: View, Equatable {
|
|
let nodeColor: UIColor
|
|
let shortName: String?
|
|
let hasDetectionSensorMetrics: Bool
|
|
let isOnline: Bool
|
|
let calculatedDelay: Double
|
|
private let swiftUIColor: Color
|
|
|
|
init(nodeColor: UIColor, shortName: String?, hasDetectionSensorMetrics: Bool, isOnline: Bool, calculatedDelay: Double) {
|
|
self.nodeColor = nodeColor
|
|
self.shortName = shortName
|
|
self.hasDetectionSensorMetrics = hasDetectionSensorMetrics
|
|
self.isOnline = isOnline
|
|
self.calculatedDelay = calculatedDelay
|
|
self.swiftUIColor = Color(nodeColor)
|
|
}
|
|
|
|
var body: some View {
|
|
ZStack {
|
|
// Pass the calculatedDelay to the PulsingCircle view
|
|
if isOnline {
|
|
PulsingCircle(nodeColor: nodeColor, calculatedDelay: calculatedDelay)
|
|
}
|
|
|
|
if hasDetectionSensorMetrics {
|
|
Image(systemName: "sensor.fill")
|
|
.symbolRenderingMode(.palette)
|
|
.symbolEffect(.variableColor)
|
|
.padding()
|
|
.foregroundStyle(.white)
|
|
.background(swiftUIColor)
|
|
.clipShape(Circle())
|
|
} else {
|
|
CircleText(text: shortName ?? "?", color: swiftUIColor, circleSize: 40)
|
|
}
|
|
}
|
|
}
|
|
|
|
static func == (lhs: AnimatedNodePin, rhs: AnimatedNodePin) -> Bool {
|
|
return lhs.nodeColor == rhs.nodeColor &&
|
|
lhs.shortName == rhs.shortName &&
|
|
lhs.hasDetectionSensorMetrics == rhs.hasDetectionSensorMetrics &&
|
|
lhs.isOnline == rhs.isOnline &&
|
|
lhs.calculatedDelay == rhs.calculatedDelay // Include calculatedDelay to ensure changes in animation timing trigger UI updates
|
|
}
|
|
}
|
|
|
|
struct PulsingCircle: View {
|
|
let nodeColor: UIColor
|
|
let calculatedDelay: Double
|
|
@State private var isPulsing = false
|
|
|
|
var body: some View {
|
|
Circle()
|
|
.fill(Color(nodeColor.lighter()).opacity(0.4))
|
|
.frame(width: 55, height: 55)
|
|
.scaleEffect(isPulsing ? 1.2 : 0.8)
|
|
.animation(
|
|
.easeInOut(duration: 0.8).repeatForever(autoreverses: true).delay(calculatedDelay),
|
|
value: isPulsing
|
|
)
|
|
.onAppear {
|
|
isPulsing = true
|
|
}
|
|
}
|
|
}
|