mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Merge pull request #238 from meshtastic/2.0_Alpha_Launch
Share position feature for catalyst
This commit is contained in:
commit
a769dcd5e6
2 changed files with 62 additions and 12 deletions
|
|
@ -230,6 +230,35 @@ struct ChannelMessageList: View {
|
|||
}
|
||||
})
|
||||
}
|
||||
#if targetEnvironment(macCatalyst)
|
||||
HStack {
|
||||
Spacer()
|
||||
Button {
|
||||
let userLongName = bleManager.connectedPeripheral != nil ? bleManager.connectedPeripheral.longName : "Unknown"
|
||||
sendPositionWithMessage = true
|
||||
if userSettings.meshtasticUsername.count > 0 {
|
||||
|
||||
typingMessage = "📍 " + userSettings.meshtasticUsername + " has shared their position with you from node " + userLongName
|
||||
|
||||
} else {
|
||||
|
||||
typingMessage = "📍 " + userLongName + " has shared their position with you."
|
||||
}
|
||||
|
||||
} label: {
|
||||
Text("Share Position")
|
||||
Image(systemName: "mappin.and.ellipse")
|
||||
.symbolRenderingMode(.hierarchical)
|
||||
.imageScale(.large).foregroundColor(.accentColor)
|
||||
}
|
||||
ProgressView("Bytes: \(totalBytes) / \(maxbytes)", value: Double(totalBytes), total: Double(maxbytes))
|
||||
.frame(width: 130)
|
||||
.padding(5)
|
||||
.font(.subheadline)
|
||||
.accentColor(.accentColor)
|
||||
.padding(.trailing)
|
||||
}
|
||||
#endif
|
||||
HStack(alignment: .top) {
|
||||
|
||||
ZStack {
|
||||
|
|
|
|||
|
|
@ -232,8 +232,35 @@ struct UserMessageList: View {
|
|||
}
|
||||
})
|
||||
}
|
||||
HStack(alignment: .top) {
|
||||
#if targetEnvironment(macCatalyst)
|
||||
HStack {
|
||||
Spacer()
|
||||
Button {
|
||||
let userLongName = bleManager.connectedPeripheral != nil ? bleManager.connectedPeripheral.longName : "Unknown"
|
||||
sendPositionWithMessage = true
|
||||
|
||||
if userSettings.meshtasticUsername.count > 0 {
|
||||
typingMessage = "📍 " + userSettings.meshtasticUsername + " has shared their position with you from node " + userLongName + " and requested a response with your position."
|
||||
} else {
|
||||
typingMessage = "📍 " + userLongName + " has shared their position and requested a response with your position."
|
||||
}
|
||||
|
||||
} label: {
|
||||
Text("Share Position")
|
||||
Image(systemName: "mappin.and.ellipse")
|
||||
.symbolRenderingMode(.hierarchical)
|
||||
.imageScale(.large).foregroundColor(.accentColor)
|
||||
}
|
||||
ProgressView("Bytes: \(totalBytes) / \(maxbytes)", value: Double(totalBytes), total: Double(maxbytes))
|
||||
.frame(width: 130)
|
||||
.padding(5)
|
||||
.font(.subheadline)
|
||||
.accentColor(.accentColor)
|
||||
.padding(.trailing)
|
||||
}
|
||||
#endif
|
||||
|
||||
HStack(alignment: .top) {
|
||||
ZStack {
|
||||
let kbType = UIKeyboardType(rawValue: UserDefaults.standard.object(forKey: "keyboardType") as? Int ?? 0)
|
||||
TextField("Message", text: $typingMessage, axis: .vertical)
|
||||
|
|
@ -261,19 +288,13 @@ struct UserMessageList: View {
|
|||
Button {
|
||||
let userLongName = bleManager.connectedPeripheral != nil ? bleManager.connectedPeripheral.longName : "Unknown"
|
||||
sendPositionWithMessage = true
|
||||
if user.num == bleManager.broadcastNodeNum {
|
||||
if userSettings.meshtasticUsername.count > 0 {
|
||||
typingMessage = "📍 " + userSettings.meshtasticUsername + " has shared their position with the mesh from node " + userLongName
|
||||
} else {
|
||||
typingMessage = "📍 " + userLongName + " has shared their position with the mesh."
|
||||
}
|
||||
|
||||
if userSettings.meshtasticUsername.count > 0 {
|
||||
typingMessage = "📍 " + userSettings.meshtasticUsername + " has shared their position with you from node " + userLongName + " and requested a response with your position."
|
||||
} else {
|
||||
if userSettings.meshtasticUsername.count > 0 {
|
||||
typingMessage = "📍 " + userSettings.meshtasticUsername + " has shared their position with you from node " + userLongName
|
||||
} else {
|
||||
typingMessage = "📍 " + userLongName + " has shared their position with you."
|
||||
}
|
||||
typingMessage = "📍 " + userLongName + " has shared their position and requested a response with your position."
|
||||
}
|
||||
|
||||
} label: {
|
||||
Image(systemName: "mappin.and.ellipse")
|
||||
.symbolRenderingMode(.hierarchical)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue