Implement keyboard toolbar

This commit is contained in:
Garth Vander Houwen 2021-10-15 00:52:48 -07:00
parent df4a70b672
commit c2cb860ab2
6 changed files with 39 additions and 34 deletions

View file

@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 52;
objectVersion = 55;
objects = {
/* Begin PBXBuildFile section */
@ -403,7 +403,7 @@
};
};
buildConfigurationList = DDC2E14F26CE248E0042C5E4 /* Build configuration list for PBXProject "Meshtastic Client" */;
compatibilityVersion = "Xcode 9.3";
compatibilityVersion = "Xcode 13.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
@ -659,7 +659,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.25.6;
MARKETING_VERSION = 1.25.7;
PRODUCT_BUNDLE_IDENTIFIER = gvh.MeshtasticClient;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTS_MACCATALYST = NO;
@ -686,7 +686,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.25.6;
MARKETING_VERSION = 1.25.7;
PRODUCT_BUNDLE_IDENTIFIER = gvh.MeshtasticClient;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTS_MACCATALYST = NO;

View file

@ -44,6 +44,7 @@
<key>UIBackgroundModes</key>
<array>
<string>bluetooth-central</string>
<string>location</string>
</array>
<key>UILaunchScreen</key>
<dict/>

View file

@ -21,25 +21,25 @@ struct ContentView: View {
Channels()
.tabItem {
Label("Messages", systemImage: "text.bubble")
.symbolRenderingMode(.hierarchical)
.symbolVariant(.none)
}
.tag(Tab.messages)
NodeList()
.tabItem {
Label("Nodes", systemImage: "flipphone")
.symbolRenderingMode(.hierarchical)
.symbolVariant(.none)
}
.tag(Tab.nodes)
NodeMap()
.tabItem {
Label("Mesh Map", systemImage: "map")
.symbolRenderingMode(.hierarchical)
.symbolVariant(.none)
}
.tag(Tab.map)
Connect()
.tabItem {
Label("Bluetooth", systemImage: "dot.radiowaves.left.and.right")
.symbolRenderingMode(.hierarchical)
.symbolVariant(.none)
}
.tag(Tab.ble)
//AppSettings()

View file

@ -19,15 +19,14 @@ struct Channels: View {
HStack {
Image(systemName: "dial.max.fill")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 70, height: 70)
.foregroundColor(Color.blue)
.font(.system(size: 62))
.symbolRenderingMode(.hierarchical)
.padding(.trailing)
.foregroundColor(Color.blue)
Text("Primary")
.font(.largeTitle)
}.padding()
}
}

View file

@ -75,6 +75,24 @@ struct Messages: View {
}
})
.keyboardType(.default)
.toolbar
{
ToolbarItemGroup(placement: .keyboard) {
Button("Dismiss Keyboard") {
focusedField = nil
}
.font(.subheadline)
Spacer()
ProgressView("Bytes: \(totalBytes) / 200", value: Double(totalBytes), total: 200)
.frame(width: 130)
.padding(5)
.font(.subheadline)
.accentColor(Color.blue)
}
}
.padding(.horizontal, 8)
.focused($focusedField, equals: .messageText)
.multilineTextAlignment(.leading)
@ -106,22 +124,6 @@ struct Messages: View {
}
.padding(.all, 15)
HStack (alignment: .top ) {
if focusedField != nil {
Button("Dismiss Keyboard") {
focusedField = nil
}
.font(.subheadline)
Spacer()
ProgressView("Bytes: \(totalBytes) / 200", value: Double(totalBytes), total: 200)
.frame(width: 130)
.padding(.bottom, 7)
.font(.subheadline)
.accentColor(Color.blue)
}
}
.padding(.horizontal)
}
}
.navigationTitle("Channel - Primary")

View file

@ -28,16 +28,19 @@ struct NodeList: View {
List {
if meshData.nodes.count == 0 {
Text("Scan for Radios").font(.largeTitle).listRowSeparator(.hidden)
Text("No LoRa Mesh Nodes Found").font(.title2).listRowSeparator(.hidden)
Text("Scan for Radios").font(.largeTitle)
//.listRowSeparator(.hidden)
Text("No LoRa Mesh Nodes Found").font(.title2)
//.listRowSeparator(.hidden)
Text("Go to the bluetooth section in the bottom right menu and click the Start Scanning button to scan for nearby radios and find your Meshtastic device. Make sure your device is powered on and near your phone or tablet.")
.font(.body)
.listRowSeparator(.hidden)
//.listRowSeparator(.hidden)
Text("Once the device shows under Available Devices touch the device you want to connect to and it will pull node information over BLE and populate the node list and mesh map in the Meshtastic app.")
.listRowSeparator(.hidden)
//.listRowSeparator(.hidden)
Text("Views with bluetooth functionality will show an indicator in the upper right hand corner show if bluetooth is on, and if a device is connected.")
.listRowSeparator(.hidden)
Spacer().listRowSeparator(.hidden)
//.listRowSeparator(.hidden)
Spacer()
//.listRowSeparator(.hidden)
}
else {
Toggle(isOn: $showLocationOnly) {