mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Messaging mockup, node list cleanup
This commit is contained in:
parent
93cfda20ed
commit
cb0264af32
10 changed files with 63 additions and 74 deletions
|
|
@ -40,7 +40,6 @@
|
|||
DDC2E16F26CE248F0042C5E4 /* MeshtasticClientTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDC2E16E26CE248F0042C5E4 /* MeshtasticClientTests.swift */; };
|
||||
DDC2E17A26CE248F0042C5E4 /* MeshtasticClientUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDC2E17926CE248F0042C5E4 /* MeshtasticClientUITests.swift */; };
|
||||
DDC2E18F26CE25FE0042C5E4 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDC2E18E26CE25FE0042C5E4 /* ContentView.swift */; };
|
||||
DDC2E19126CE26290042C5E4 /* Messages.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDC2E19026CE26290042C5E4 /* Messages.swift */; };
|
||||
DDC2E1A726CEB3400042C5E4 /* LocationHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDC2E1A626CEB3400042C5E4 /* LocationHelper.swift */; };
|
||||
DDF924C626FA2375009FE055 /* MessageModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDF924C526FA2375009FE055 /* MessageModel.swift */; };
|
||||
DDF924CA26FBB953009FE055 /* ConnectedDevice.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDF924C926FBB953009FE055 /* ConnectedDevice.swift */; };
|
||||
|
|
@ -104,7 +103,6 @@
|
|||
DDC2E17926CE248F0042C5E4 /* MeshtasticClientUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeshtasticClientUITests.swift; sourceTree = "<group>"; };
|
||||
DDC2E17B26CE248F0042C5E4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
DDC2E18E26CE25FE0042C5E4 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
|
||||
DDC2E19026CE26290042C5E4 /* Messages.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Messages.swift; sourceTree = "<group>"; };
|
||||
DDC2E1A626CEB3400042C5E4 /* LocationHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationHelper.swift; sourceTree = "<group>"; };
|
||||
DDF924C526FA2375009FE055 /* MessageModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageModel.swift; sourceTree = "<group>"; };
|
||||
DDF924C926FBB953009FE055 /* ConnectedDevice.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectedDevice.swift; sourceTree = "<group>"; };
|
||||
|
|
@ -280,7 +278,6 @@
|
|||
DDC2E18B26CE25A70042C5E4 /* Messages */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
DDC2E19026CE26290042C5E4 /* Messages.swift */,
|
||||
DD47E3DA26F3901A00029299 /* MessageList.swift */,
|
||||
DD47E3DC26F390A000029299 /* MessageDetail.swift */,
|
||||
);
|
||||
|
|
@ -453,7 +450,6 @@
|
|||
DDAF8C5F26ED09B50058C060 /* radioconfig.pb.swift in Sources */,
|
||||
DDAF8C5326EB1DF10058C060 /* BLEManager.swift in Sources */,
|
||||
DD90860E26F69BAE00DC5189 /* NodeMap.swift in Sources */,
|
||||
DDC2E19126CE26290042C5E4 /* Messages.swift in Sources */,
|
||||
DD47E3DB26F3901B00029299 /* MessageList.swift in Sources */,
|
||||
DDAF8C6926ED0D070058C060 /* deviceonly.pb.swift in Sources */,
|
||||
DD836AED26F858F900ABCC23 /* MeshData.swift in Sources */,
|
||||
|
|
@ -645,7 +641,7 @@
|
|||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.12;
|
||||
MARKETING_VERSION = 1.13;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = gvh.MeshtasticClient;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
|
|
@ -671,7 +667,7 @@
|
|||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.12;
|
||||
MARKETING_VERSION = 1.13;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = gvh.MeshtasticClient;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
|
|
|
|||
|
|
@ -158,6 +158,8 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
{
|
||||
if(peripheral.identifier == connectedPeripheral.identifier){
|
||||
connectedPeripheral = nil
|
||||
connectedNodeInfo = nil
|
||||
connectedNode = nil
|
||||
}
|
||||
print("Peripheral disconnected: " + peripheral.name!)
|
||||
self.startScanning()
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ struct Connect: View {
|
|||
.background(Color(.systemGray6))
|
||||
.clipShape(Capsule())
|
||||
Spacer()
|
||||
}.padding(.bottom, 25)
|
||||
}.padding(.bottom, 10)
|
||||
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ Abstract: Default App View
|
|||
import SwiftUI
|
||||
|
||||
struct ContentView: View {
|
||||
@State private var selection: Tab = .nodes
|
||||
@State private var selection: Tab = .messages
|
||||
|
||||
enum Tab {
|
||||
case messages
|
||||
|
|
|
|||
|
|
@ -10,11 +10,13 @@ struct CircleText: View {
|
|||
var color: Color
|
||||
|
||||
var body: some View {
|
||||
|
||||
Text(text).font(.caption2).foregroundColor(.white)
|
||||
.background(Circle()
|
||||
.fill(color)
|
||||
.frame(width: 32, height: 32, alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/))
|
||||
ZStack {
|
||||
Circle()
|
||||
.fill(color)
|
||||
.frame(width: 36, height: 36)
|
||||
Text(text).textCase(.uppercase).font(.caption2).foregroundColor(.white)
|
||||
.frame(width: 36, height: 36, alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/).offset(x: 0, y: 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ struct ConnectedDevice: View {
|
|||
if bluetoothOn {
|
||||
if deviceConnected {
|
||||
Image(systemName: "antenna.radiowaves.left.and.right")
|
||||
.imageScale(.large)
|
||||
.imageScale(.medium)
|
||||
.foregroundColor(.green)
|
||||
.symbolRenderingMode(.hierarchical)
|
||||
Text(name!).font(.caption2).foregroundColor(.gray)
|
||||
|
|
@ -26,7 +26,7 @@ struct ConnectedDevice: View {
|
|||
else {
|
||||
|
||||
Image(systemName: "antenna.radiowaves.left.and.right.slash")
|
||||
.imageScale(.large)
|
||||
.imageScale(.medium)
|
||||
.foregroundColor(.red)
|
||||
.symbolRenderingMode(.hierarchical)
|
||||
Text("Disconnected").font(.caption2).foregroundColor(.gray)
|
||||
|
|
@ -37,7 +37,7 @@ struct ConnectedDevice: View {
|
|||
Text("Bluetooth Off").font(.caption).foregroundColor(.red)
|
||||
}
|
||||
}
|
||||
}.offset(x: 5, y: -10)
|
||||
}.offset(x: 5, y: -7)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,15 +7,25 @@ struct MessageDetail: View {
|
|||
@State var typingMessage: String = ""
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
// NavigationView {
|
||||
|
||||
VStack(alignment: .leading) {
|
||||
ScrollView {
|
||||
|
||||
MessageBubble(contentMessage: "I sent a super great message with amazing text", isCurrentUser: true, time: 1, shortName: "GVH")
|
||||
MessageBubble(contentMessage: "It was amazing to read such a fantastical text", isCurrentUser: false, time: 1, shortName: "RS1")
|
||||
MessageBubble(contentMessage: "It was the best message", isCurrentUser: false, time: 1, shortName: "RDN")
|
||||
MessageBubble(contentMessage: "This is a terse response to an amazing text", isCurrentUser: true, time: 1, shortName: "GVH")
|
||||
MessageBubble(contentMessage: "yo", isCurrentUser: true, time: 1, shortName: "GVH")
|
||||
MessageBubble(contentMessage: "I sent a super great message with amazing text", isCurrentUser: true, time: 1, shortName: "GVH")
|
||||
MessageBubble(contentMessage: "It was amazing to read such a fantastical text", isCurrentUser: false, time: 1, shortName: "RS1")
|
||||
MessageBubble(contentMessage: "It was the best message", isCurrentUser: false, time: 1, shortName: "RDN")
|
||||
MessageBubble(contentMessage: "This is a terse response to an amazing text", isCurrentUser: true, time: 1, shortName: "GVH")
|
||||
MessageBubble(contentMessage: "yo", isCurrentUser: true, time: 1, shortName: "GVH")
|
||||
|
||||
|
||||
|
||||
|
||||
}.padding([.top, .leading])
|
||||
HStack (alignment: .bottom) {
|
||||
|
||||
|
|
@ -27,9 +37,9 @@ struct MessageDetail: View {
|
|||
}
|
||||
}.padding(5)
|
||||
}
|
||||
.navigationTitle("Broadcast Channel")
|
||||
.navigationTitle("CHANNEL - Primary")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
}
|
||||
//}
|
||||
//.navigationViewStyle//(StackNavigationViewStyle())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,28 +9,41 @@ struct MessageList: View {
|
|||
@EnvironmentObject var bleManager: BLEManager
|
||||
@EnvironmentObject var meshData: MeshData
|
||||
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
|
||||
|
||||
GeometryReader { bounds in
|
||||
|
||||
ScrollView {
|
||||
Text(String(bleManager.isSwitchedOn))
|
||||
Text(String(bleManager.connectedPeripheral != nil))
|
||||
}.padding(.all)
|
||||
|
||||
List{
|
||||
|
||||
NavigationLink(destination: MessageDetail()) {
|
||||
|
||||
HStack {
|
||||
|
||||
Image(systemName: "dial.max.fill")
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.frame(width: bounds.size.width / 7, height: bounds.size.height / 7)
|
||||
.foregroundColor(Color.blue)
|
||||
.symbolRenderingMode(.hierarchical)
|
||||
.padding(.trailing)
|
||||
|
||||
Text("Primary")
|
||||
.font(.largeTitle)
|
||||
}.padding([.leading, .trailing])
|
||||
}
|
||||
}
|
||||
}
|
||||
.navigationTitle("Channels")
|
||||
.navigationTitle("Message Channels")
|
||||
.navigationBarItems(trailing:
|
||||
|
||||
ZStack {
|
||||
|
||||
ConnectedDevice(bluetoothOn: bleManager.isSwitchedOn, deviceConnected: bleManager.connectedPeripheral != nil, name: (bleManager.connectedNode != nil) ? bleManager.connectedNode.user.longName : ((bleManager.connectedPeripheral != nil) ? bleManager.connectedPeripheral.name : "Unknown") ?? "Unknown")
|
||||
ConnectedDevice(bluetoothOn: bleManager.isSwitchedOn, deviceConnected: bleManager.connectedPeripheral != nil, name: (bleManager.connectedNode != nil) ? bleManager.connectedNode.user.longName : ((bleManager.connectedPeripheral != nil) ? bleManager.connectedPeripheral.name : "Unknown") ?? "Unknown")
|
||||
|
||||
}
|
||||
)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
}
|
||||
}.navigationViewStyle(StackNavigationViewStyle())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -39,8 +52,7 @@ struct MessageList_Previews: PreviewProvider {
|
|||
|
||||
static var previews: some View {
|
||||
Group {
|
||||
//NodeDetail(node: modelData.nodes[0]).environmentObject(modelData)
|
||||
// NodeDetail(node: modelData.nodes[1]).environmentObject(modelData)
|
||||
MessageList()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,36 +0,0 @@
|
|||
import SwiftUI
|
||||
import MapKit
|
||||
import CoreLocation
|
||||
|
||||
struct Messages: View {
|
||||
|
||||
@State var typingMessage: String = ""
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
|
||||
VStack(alignment: .leading) {
|
||||
ScrollView {
|
||||
MessageBubble(contentMessage: "I sent a super great message with amazing text", isCurrentUser: true, time: 1, shortName: "GVH")
|
||||
MessageBubble(contentMessage: "It was amazing to read such a fantastical text", isCurrentUser: false, time: 1, shortName: "RS1")
|
||||
MessageBubble(contentMessage: "It was the best message", isCurrentUser: false, time: 1, shortName: "RDN")
|
||||
MessageBubble(contentMessage: "This is a terse response to an amazing text", isCurrentUser: true, time: 1, shortName: "GVH")
|
||||
MessageBubble(contentMessage: "yo", isCurrentUser: true, time: 1, shortName: "GVH")
|
||||
}.padding([.top, .leading])
|
||||
HStack (alignment: .bottom) {
|
||||
|
||||
TextField("Message", text: $typingMessage)
|
||||
.keyboardType(.asciiCapable)
|
||||
.textFieldStyle(RoundedBorderTextFieldStyle())
|
||||
.frame(minHeight: CGFloat(30))
|
||||
Button(action: sendMessage) {
|
||||
Image(systemName: "arrow.up.circle.fill").font(.title).foregroundColor(.blue)
|
||||
}
|
||||
}.padding(5)
|
||||
}
|
||||
.navigationTitle("Broadcast Channel")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
}
|
||||
.navigationViewStyle(StackNavigationViewStyle())
|
||||
}
|
||||
}
|
||||
|
|
@ -6,17 +6,20 @@ struct NodeRow: View {
|
|||
|
||||
var body: some View {
|
||||
VStack (alignment: .leading) {
|
||||
|
||||
HStack() {
|
||||
|
||||
CircleText(text: node.user.shortName, color: Color.blue).offset(y: 1).padding(.trailing, 5)
|
||||
Text(node.user.longName).font(.title2)
|
||||
}.padding(.bottom, 2)
|
||||
HStack (alignment: .top){
|
||||
Text(node.user.longName).font(.title)
|
||||
}
|
||||
.padding([.trailing])
|
||||
|
||||
HStack (alignment: .bottom){
|
||||
|
||||
Image(systemName: "clock").font(.caption).foregroundColor(.blue).symbolRenderingMode(.hierarchical)
|
||||
Image(systemName: "timer").font(.headline).foregroundColor(.blue).symbolRenderingMode(.hierarchical)
|
||||
let lastHeard = Date(timeIntervalSince1970: TimeInterval(node.lastHeard))
|
||||
Text("Last Heard:").font(.caption).foregroundColor(.gray)
|
||||
Text(lastHeard, style: .relative).font(.caption).foregroundColor(.gray)
|
||||
Text("Last Heard:").font(.headline).foregroundColor(.gray)
|
||||
Text(lastHeard, style: .relative).font(.subheadline).foregroundColor(.gray)
|
||||
}
|
||||
}.padding([.leading, .top, .bottom])
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue