mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Add node map preview clean up old code
This commit is contained in:
parent
b6abb65643
commit
c1c2f3730a
4 changed files with 32 additions and 17 deletions
|
|
@ -92,17 +92,25 @@ struct Connect: View {
|
|||
}
|
||||
}
|
||||
.navigationTitle("Bluetooth Radios")
|
||||
//.navigationBarItems(leading:
|
||||
//HStack {
|
||||
//Button(action: {
|
||||
// self.bleManager.startScanning()
|
||||
//}) {
|
||||
// Image(systemName: "arrow.clockwise.circle").imageScale(.large)
|
||||
//}}, trailing:
|
||||
//HStack {
|
||||
|
||||
//}
|
||||
//)
|
||||
.navigationBarItems(trailing:
|
||||
HStack {
|
||||
Button(action: {
|
||||
self.bleManager.startScanning()
|
||||
}) {
|
||||
Image(systemName: "arrow.clockwise.circle").imageScale(.large)
|
||||
}}
|
||||
)
|
||||
}.navigationViewStyle(StackNavigationViewStyle())
|
||||
}
|
||||
}
|
||||
|
||||
struct Connect_Previews: PreviewProvider {
|
||||
static let modelData = ModelData()
|
||||
static let bleManager = BLEManager()
|
||||
|
||||
static var previews: some View {
|
||||
Connect(bleManager: bleManager)
|
||||
.environmentObject(ModelData())
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,15 +6,12 @@ A view showing the details for a node.
|
|||
import SwiftUI
|
||||
import MapKit
|
||||
import CoreLocation
|
||||
import CoreBluetooth
|
||||
|
||||
struct NodeDetail: View {
|
||||
|
||||
@EnvironmentObject var modelData: ModelData
|
||||
var node: NodeInfoModel
|
||||
|
||||
var coord = CLLocationCoordinate2D()
|
||||
|
||||
struct MapLocation: Identifiable {
|
||||
let id = UUID()
|
||||
let name: String
|
||||
|
|
@ -27,7 +24,6 @@ struct NodeDetail: View {
|
|||
|
||||
VStack {
|
||||
|
||||
// Map or Device Image
|
||||
if(node.position.coordinate != nil) {
|
||||
|
||||
let nodeCoordinatePosition = CLLocationCoordinate2D(latitude: node.position.latitude!, longitude: node.position.longitude!)
|
||||
|
|
@ -63,7 +59,9 @@ struct NodeDetail: View {
|
|||
|
||||
Image(node.user.hwModel.lowercased())
|
||||
.resizable()
|
||||
.frame(width: 70, height: 70)
|
||||
.frame(width:70, height: 70)
|
||||
.cornerRadius(5)
|
||||
|
||||
Text("Model: " + String(node.user.hwModel))
|
||||
.font(.title)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ struct NodeList: View {
|
|||
|
||||
List {
|
||||
Toggle(isOn: $showLocationOnly) {
|
||||
Text("Nodes with Location only")
|
||||
Text("Nodes with location only")
|
||||
}
|
||||
ForEach(filteredDevices.sorted(by: { $0.lastHeard > $1.lastHeard })) { node in
|
||||
NavigationLink(destination: NodeDetail(node: node)) {
|
||||
|
|
|
|||
|
|
@ -56,3 +56,12 @@ struct NodeMap: View {
|
|||
}.navigationViewStyle(StackNavigationViewStyle())
|
||||
}
|
||||
}
|
||||
|
||||
struct NodeMap_Previews: PreviewProvider {
|
||||
static let modelData = ModelData()
|
||||
|
||||
static var previews: some View {
|
||||
NodeMap()
|
||||
.environmentObject(modelData)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue