diff --git a/Meshtastic Client.xcodeproj/project.pbxproj b/Meshtastic Client.xcodeproj/project.pbxproj index ac85eaa9..e91bf92c 100644 --- a/Meshtastic Client.xcodeproj/project.pbxproj +++ b/Meshtastic Client.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + DD1BF2F92776FE2E008C8D2F /* UserMessageList.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD1BF2F82776FE2E008C8D2F /* UserMessageList.swift */; }; DD23A50F26FD1B4400D9B90C /* PeripheralModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD23A50E26FD1B4400D9B90C /* PeripheralModel.swift */; }; DD2E65262767A01F00E45FC5 /* NodeDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD2E65252767A01F00E45FC5 /* NodeDetail.swift */; }; DD47E3CE26F103C600029299 /* NodeList.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD47E3CD26F103C600029299 /* NodeList.swift */; }; @@ -68,6 +69,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + DD1BF2F82776FE2E008C8D2F /* UserMessageList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserMessageList.swift; sourceTree = ""; }; DD23A50E26FD1B4400D9B90C /* PeripheralModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PeripheralModel.swift; sourceTree = ""; }; DD2E65252767A01F00E45FC5 /* NodeDetail.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NodeDetail.swift; sourceTree = ""; }; DD47E3CD26F103C600029299 /* NodeList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NodeList.swift; sourceTree = ""; }; @@ -296,6 +298,7 @@ DD47E3DA26F3901A00029299 /* Channels.swift */, DD47E3DC26F390A000029299 /* Messages.swift */, DD882F5C2772E4640005BF05 /* Contacts.swift */, + DD1BF2F82776FE2E008C8D2F /* UserMessageList.swift */, ); path = Messages; sourceTree = ""; @@ -508,6 +511,7 @@ DDF924CA26FBB953009FE055 /* ConnectedDevice.swift in Sources */, DDAF8C5D26ED09490058C060 /* portnums.pb.swift in Sources */, DD9D8F2F2764403B00080993 /* Meshtastic.xcdatamodeld in Sources */, + DD1BF2F92776FE2E008C8D2F /* UserMessageList.swift in Sources */, DD23A50F26FD1B4400D9B90C /* PeripheralModel.swift in Sources */, DD882F5D2772E4640005BF05 /* Contacts.swift in Sources */, DD47E3CE26F103C600029299 /* NodeList.swift in Sources */, @@ -695,7 +699,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.35; + MARKETING_VERSION = 1.36; PRODUCT_BUNDLE_IDENTIFIER = gvh.MeshtasticClient; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTS_MACCATALYST = YES; @@ -722,7 +726,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.35; + MARKETING_VERSION = 1.36; PRODUCT_BUNDLE_IDENTIFIER = gvh.MeshtasticClient; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTS_MACCATALYST = YES; diff --git a/Meshtastic Client.xcodeproj/xcuserdata/garthvanderhouwen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/Meshtastic Client.xcodeproj/xcuserdata/garthvanderhouwen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index 5acce548..40af0c6f 100644 --- a/Meshtastic Client.xcodeproj/xcuserdata/garthvanderhouwen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/Meshtastic Client.xcodeproj/xcuserdata/garthvanderhouwen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -80,22 +80,6 @@ landmarkType = "24"> - - - - + + + + + + + + diff --git a/MeshtasticClient/Helpers/BLEManager.swift b/MeshtasticClient/Helpers/BLEManager.swift index 9af3fb15..0f2ba231 100644 --- a/MeshtasticClient/Helpers/BLEManager.swift +++ b/MeshtasticClient/Helpers/BLEManager.swift @@ -473,6 +473,7 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph connectedPeripheral.name = decodedInfo.nodeInfo.user.longName connectedPeripheral.longName = decodedInfo.nodeInfo.user.longName connectedPeripheral.shortName = decodedInfo.nodeInfo.user.shortName + connectedPeripheral.num = Int64(decodedInfo.nodeInfo.num) } } @@ -629,7 +630,7 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph // Save the broadcast user if it does not exist let bcu: UserEntity = UserEntity(context: context!) bcu.shortName = "ALL" - bcu.longName = "Broadcast (^all)" + bcu.longName = "Primary - Broadcast" bcu.hwModel = "UNSET" bcu.num = Int64(broadcastNodeNum) bcu.userId = "BROADCASTNODE" @@ -860,7 +861,7 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph let bcu: UserEntity = UserEntity(context: context!) bcu.shortName = "ALL" - bcu.longName = "Broadcast (^all)" + bcu.longName = "Primary - Broadcast" bcu.hwModel = "UNSET" bcu.num = Int64(broadcastNodeNum) bcu.userId = "BROADCASTNODE" diff --git a/MeshtasticClient/Views/Messages/Contacts.swift b/MeshtasticClient/Views/Messages/Contacts.swift index 8f071694..fbb05da6 100644 --- a/MeshtasticClient/Views/Messages/Contacts.swift +++ b/MeshtasticClient/Views/Messages/Contacts.swift @@ -16,10 +16,12 @@ struct Contacts: View { sortDescriptors: [NSSortDescriptor(key: "longName", ascending: true)], animation: .default) - private var users: FetchedResults + private var users: FetchedResults var body: some View { + NavigationView { + List(users) { user in if user.receivedMessages?.count ?? 0 > 0 { @@ -30,18 +32,24 @@ struct Contacts: View { let currentDay = Calendar.current.dateComponents([.day], from: Date()).day ?? 0 HStack { - VStack { - CircleText(text: user.shortName ?? "???", color: Color.blue) - } + VStack { - HStack (alignment: .bottom){ + CircleText(text: user.shortName ?? "???", color: Color.blue) + } + .padding([.leading, .trailing]) + + VStack { + + HStack { VStack { - Text(user.longName ?? "Unknown").font(.headline) + + Text(user.longName ?? "Unknown").font(.headline).fixedSize() } VStack { + if lastMessageDay == currentDay { Text(lastMessageTime, style: .time ) @@ -65,27 +73,41 @@ struct Contacts: View { }.frame(maxWidth: .infinity, alignment: .trailing) } .listRowSeparator(.hidden).frame(height: 5) + HStack (alignment: .top) { - Text(mostRecent.messagePayload ?? "EMPTY MESSSAGE") .frame(height: 60) .truncationMode(.tail) + .foregroundColor(Color.gray) + .frame(maxWidth: .infinity, alignment: .leading) } - } - }.padding(10) + }.padding(.top, 15) + } } else { + HStack { + VStack { + CircleText(text: user.shortName ?? "???", color: Color.blue) } + .padding(.trailing) + VStack { HStack{ VStack { - Text(user.longName ?? "Unknown").font(.title3) + + Text(user.longName ?? "Unknown").font(.headline).fixedSize() } + + VStack { + Text(" ") + } + .frame(maxWidth: .infinity, alignment: .trailing) } + .listRowSeparator(.hidden).frame(height: 5) } }.padding() } @@ -93,6 +115,7 @@ struct Contacts: View { } .navigationTitle("Contacts") } + .listStyle(PlainListStyle()) } } diff --git a/MeshtasticClient/Views/Messages/UserMessageList.swift b/MeshtasticClient/Views/Messages/UserMessageList.swift new file mode 100644 index 00000000..56411298 --- /dev/null +++ b/MeshtasticClient/Views/Messages/UserMessageList.swift @@ -0,0 +1,20 @@ +// +// UserMessageList.swift +// MeshtasticClient +// +// Created by Garth Vander Houwen on 12/24/21. +// + +import SwiftUI + +struct UserMessageList: View { + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +struct UserMessageList_Previews: PreviewProvider { + static var previews: some View { + UserMessageList() + } +}