Commit 460c8567 authored by sugita mamoru's avatar sugita mamoru

webView実装、スライダー修正、メニュー画面変更

parent f2d52421
...@@ -44,10 +44,13 @@ ...@@ -44,10 +44,13 @@
022789092AE1FE4C00A87787 /* Turf.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 022788F72AE1FE3C00A87787 /* Turf.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 022789092AE1FE4C00A87787 /* Turf.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 022788F72AE1FE3C00A87787 /* Turf.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
0227890C2AE22E0B00A87787 /* SharingData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0227890B2AE22E0B00A87787 /* SharingData.swift */; }; 0227890C2AE22E0B00A87787 /* SharingData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0227890B2AE22E0B00A87787 /* SharingData.swift */; };
022A98202AF8B8960079C55A /* LocationCalculation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 022A981F2AF8B8960079C55A /* LocationCalculation.swift */; }; 022A98202AF8B8960079C55A /* LocationCalculation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 022A981F2AF8B8960079C55A /* LocationCalculation.swift */; };
024EDE1B2B0C41E40013BAC8 /* MenuSettingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 024EDE1A2B0C41E40013BAC8 /* MenuSettingView.swift */; };
024EDE1D2B0C42F70013BAC8 /* MenuGpsSelectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 024EDE1C2B0C42F70013BAC8 /* MenuGpsSelectView.swift */; };
025C27FA2AFE119D00BADC49 /* MenuTitleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 025C27F92AFE119D00BADC49 /* MenuTitleView.swift */; }; 025C27FA2AFE119D00BADC49 /* MenuTitleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 025C27F92AFE119D00BADC49 /* MenuTitleView.swift */; };
025C27FC2AFE191A00BADC49 /* MenuManualView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 025C27FB2AFE191A00BADC49 /* MenuManualView.swift */; }; 025C27FC2AFE191A00BADC49 /* MenuManualView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 025C27FB2AFE191A00BADC49 /* MenuManualView.swift */; };
025C27FE2B0206D700BADC49 /* PDFDownloadManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 025C27FD2B0206D700BADC49 /* PDFDownloadManager.swift */; }; 025C27FE2B0206D700BADC49 /* PDFDownloadManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 025C27FD2B0206D700BADC49 /* PDFDownloadManager.swift */; };
025C28002B034A1900BADC49 /* PDFViewer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 025C27FF2B034A1900BADC49 /* PDFViewer.swift */; }; 025C28002B034A1900BADC49 /* PDFViewer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 025C27FF2B034A1900BADC49 /* PDFViewer.swift */; };
027EF9F22B0D804C0079B825 /* WebView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 027EF9F12B0D804C0079B825 /* WebView.swift */; };
02A1DE2F2AFB4AA0005BCF55 /* ChatInputView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A1DE2E2AFB4AA0005BCF55 /* ChatInputView.swift */; }; 02A1DE2F2AFB4AA0005BCF55 /* ChatInputView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A1DE2E2AFB4AA0005BCF55 /* ChatInputView.swift */; };
02A1DE312AFB61D8005BCF55 /* MyChatContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A1DE302AFB61D8005BCF55 /* MyChatContentView.swift */; }; 02A1DE312AFB61D8005BCF55 /* MyChatContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A1DE302AFB61D8005BCF55 /* MyChatContentView.swift */; };
02A1DE332AFB654A005BCF55 /* CustomCornerRadius.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A1DE322AFB654A005BCF55 /* CustomCornerRadius.swift */; }; 02A1DE332AFB654A005BCF55 /* CustomCornerRadius.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A1DE322AFB654A005BCF55 /* CustomCornerRadius.swift */; };
...@@ -167,10 +170,13 @@ ...@@ -167,10 +170,13 @@
022788FA2AE1FE3D00A87787 /* MapboxMaps.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = MapboxMaps.xcframework; sourceTree = "<group>"; }; 022788FA2AE1FE3D00A87787 /* MapboxMaps.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = MapboxMaps.xcframework; sourceTree = "<group>"; };
0227890B2AE22E0B00A87787 /* SharingData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SharingData.swift; sourceTree = "<group>"; }; 0227890B2AE22E0B00A87787 /* SharingData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SharingData.swift; sourceTree = "<group>"; };
022A981F2AF8B8960079C55A /* LocationCalculation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = LocationCalculation.swift; path = Sailassist/Location/LocationCalculation.swift; sourceTree = SOURCE_ROOT; }; 022A981F2AF8B8960079C55A /* LocationCalculation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = LocationCalculation.swift; path = Sailassist/Location/LocationCalculation.swift; sourceTree = SOURCE_ROOT; };
024EDE1A2B0C41E40013BAC8 /* MenuSettingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MenuSettingView.swift; path = Sailassist/Menu/View/MenuSettingView.swift; sourceTree = SOURCE_ROOT; };
024EDE1C2B0C42F70013BAC8 /* MenuGpsSelectView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MenuGpsSelectView.swift; path = Sailassist/Menu/View/MenuGpsSelectView.swift; sourceTree = SOURCE_ROOT; };
025C27F92AFE119D00BADC49 /* MenuTitleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MenuTitleView.swift; path = Sailassist/Menu/View/MenuTitleView.swift; sourceTree = SOURCE_ROOT; }; 025C27F92AFE119D00BADC49 /* MenuTitleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MenuTitleView.swift; path = Sailassist/Menu/View/MenuTitleView.swift; sourceTree = SOURCE_ROOT; };
025C27FB2AFE191A00BADC49 /* MenuManualView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MenuManualView.swift; path = Sailassist/Menu/View/MenuManualView.swift; sourceTree = SOURCE_ROOT; }; 025C27FB2AFE191A00BADC49 /* MenuManualView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MenuManualView.swift; path = Sailassist/Menu/View/MenuManualView.swift; sourceTree = SOURCE_ROOT; };
025C27FD2B0206D700BADC49 /* PDFDownloadManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = PDFDownloadManager.swift; path = Sailassist/ServerSession/PDFDownloadManager.swift; sourceTree = SOURCE_ROOT; }; 025C27FD2B0206D700BADC49 /* PDFDownloadManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = PDFDownloadManager.swift; path = Sailassist/ServerSession/PDFDownloadManager.swift; sourceTree = SOURCE_ROOT; };
025C27FF2B034A1900BADC49 /* PDFViewer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = PDFViewer.swift; path = Sailassist/Menu/View/PDFViewer.swift; sourceTree = SOURCE_ROOT; }; 025C27FF2B034A1900BADC49 /* PDFViewer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = PDFViewer.swift; path = Sailassist/Menu/View/PDFViewer.swift; sourceTree = SOURCE_ROOT; };
027EF9F12B0D804C0079B825 /* WebView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = WebView.swift; path = Sailassist/WebView.swift; sourceTree = SOURCE_ROOT; };
02A1DE2E2AFB4AA0005BCF55 /* ChatInputView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ChatInputView.swift; path = Sailassist/Chat/View/ChatInputView.swift; sourceTree = SOURCE_ROOT; }; 02A1DE2E2AFB4AA0005BCF55 /* ChatInputView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ChatInputView.swift; path = Sailassist/Chat/View/ChatInputView.swift; sourceTree = SOURCE_ROOT; };
02A1DE302AFB61D8005BCF55 /* MyChatContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MyChatContentView.swift; path = Sailassist/Chat/View/MyChatContentView.swift; sourceTree = SOURCE_ROOT; }; 02A1DE302AFB61D8005BCF55 /* MyChatContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MyChatContentView.swift; path = Sailassist/Chat/View/MyChatContentView.swift; sourceTree = SOURCE_ROOT; };
02A1DE322AFB654A005BCF55 /* CustomCornerRadius.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = CustomCornerRadius.swift; path = Sailassist/Chat/View/CustomCornerRadius.swift; sourceTree = SOURCE_ROOT; }; 02A1DE322AFB654A005BCF55 /* CustomCornerRadius.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = CustomCornerRadius.swift; path = Sailassist/Chat/View/CustomCornerRadius.swift; sourceTree = SOURCE_ROOT; };
...@@ -314,6 +320,7 @@ ...@@ -314,6 +320,7 @@
D5CB6F9A2B021C4F00EC2010 /* LocationViewModel.swift */, D5CB6F9A2B021C4F00EC2010 /* LocationViewModel.swift */,
D5CB6F9C2B02203500EC2010 /* RequestLocationView.swift */, D5CB6F9C2B02203500EC2010 /* RequestLocationView.swift */,
D5CB6F9E2B0220A700EC2010 /* ErrorView.swift */, D5CB6F9E2B0220A700EC2010 /* ErrorView.swift */,
027EF9F12B0D804C0079B825 /* WebView.swift */,
); );
path = SailAssist; path = SailAssist;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -527,6 +534,8 @@ ...@@ -527,6 +534,8 @@
025C27F92AFE119D00BADC49 /* MenuTitleView.swift */, 025C27F92AFE119D00BADC49 /* MenuTitleView.swift */,
025C27FB2AFE191A00BADC49 /* MenuManualView.swift */, 025C27FB2AFE191A00BADC49 /* MenuManualView.swift */,
025C27FF2B034A1900BADC49 /* PDFViewer.swift */, 025C27FF2B034A1900BADC49 /* PDFViewer.swift */,
024EDE1A2B0C41E40013BAC8 /* MenuSettingView.swift */,
024EDE1C2B0C42F70013BAC8 /* MenuGpsSelectView.swift */,
); );
path = View; path = View;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -870,6 +879,7 @@ ...@@ -870,6 +879,7 @@
020B98412AD8C3810029DE4C /* LoginView.swift in Sources */, 020B98412AD8C3810029DE4C /* LoginView.swift in Sources */,
D5AE351D2AEBA6FC00059889 /* SessionLogin.swift in Sources */, D5AE351D2AEBA6FC00059889 /* SessionLogin.swift in Sources */,
D5258C9F2B03527400365276 /* ResGetMessages.swift in Sources */, D5258C9F2B03527400365276 /* ResGetMessages.swift in Sources */,
024EDE1B2B0C41E40013BAC8 /* MenuSettingView.swift in Sources */,
020B98552AD924930029DE4C /* QrCodeScannerView.swift in Sources */, 020B98552AD924930029DE4C /* QrCodeScannerView.swift in Sources */,
02CE4D7F2ADE42A9002E79BC /* MenuContentView.swift in Sources */, 02CE4D7F2ADE42A9002E79BC /* MenuContentView.swift in Sources */,
D5AE351B2AEBA66A00059889 /* ResLogin.swift in Sources */, D5AE351B2AEBA66A00059889 /* ResLogin.swift in Sources */,
...@@ -886,6 +896,7 @@ ...@@ -886,6 +896,7 @@
02CE4D852ADF6295002E79BC /* TaskSwitchingMenuView.swift in Sources */, 02CE4D852ADF6295002E79BC /* TaskSwitchingMenuView.swift in Sources */,
D5CB6F9F2B0220A700EC2010 /* ErrorView.swift in Sources */, D5CB6F9F2B0220A700EC2010 /* ErrorView.swift in Sources */,
D5CB6F992B02088C00EC2010 /* ResShipStatus.swift in Sources */, D5CB6F992B02088C00EC2010 /* ResShipStatus.swift in Sources */,
027EF9F22B0D804C0079B825 /* WebView.swift in Sources */,
020B984B2AD915810029DE4C /* QRReadView.swift in Sources */, 020B984B2AD915810029DE4C /* QRReadView.swift in Sources */,
02A1DE332AFB654A005BCF55 /* CustomCornerRadius.swift in Sources */, 02A1DE332AFB654A005BCF55 /* CustomCornerRadius.swift in Sources */,
D545FC762B09C81300F206D0 /* PushNotificationTypes.swift in Sources */, D545FC762B09C81300F206D0 /* PushNotificationTypes.swift in Sources */,
...@@ -919,6 +930,7 @@ ...@@ -919,6 +930,7 @@
02CE4D872ADF62A7002E79BC /* EcaListView.swift in Sources */, 02CE4D872ADF62A7002E79BC /* EcaListView.swift in Sources */,
020B986C2ADD3E810029DE4C /* InTextLib.swift in Sources */, 020B986C2ADD3E810029DE4C /* InTextLib.swift in Sources */,
02C3E5D12AFCC16800AF7837 /* ChatTitleView.swift in Sources */, 02C3E5D12AFCC16800AF7837 /* ChatTitleView.swift in Sources */,
024EDE1D2B0C42F70013BAC8 /* MenuGpsSelectView.swift in Sources */,
020B98472AD8FEE30029DE4C /* ColorSet.swift in Sources */, 020B98472AD8FEE30029DE4C /* ColorSet.swift in Sources */,
D51AA4072B099FCC00EBBDD4 /* AlertDB.swift in Sources */, D51AA4072B099FCC00EBBDD4 /* AlertDB.swift in Sources */,
020B98652ADD14F60029DE4C /* NotificationView.swift in Sources */, 020B98652ADD14F60029DE4C /* NotificationView.swift in Sources */,
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
import SwiftUI import SwiftUI
struct ChatView: View { struct ChatView: View {
@EnvironmentObject private var selectedTabModel: SelectedTabModel
@ObservedObject var message = SharingData.message @ObservedObject var message = SharingData.message
@State var isShowMember: Bool = false @State var isShowMember: Bool = false
var body: some View { var body: some View {
...@@ -40,11 +41,7 @@ struct ChatView: View { ...@@ -40,11 +41,7 @@ struct ChatView: View {
Spacer() Spacer()
VStack{ VStack{
Button{ Button{
if message.mode == 0{ selectedTabModel.isShowChangeEmrMode.toggle()
message.mode = 1
}else{
message.mode = 0
}
}label: { }label: {
Image(systemName: "exclamationmark.triangle.fill") Image(systemName: "exclamationmark.triangle.fill")
.foregroundColor(.white) .foregroundColor(.white)
......
...@@ -196,8 +196,8 @@ class MapViewController : UIViewController{ ...@@ -196,8 +196,8 @@ class MapViewController : UIViewController{
switchingLabels.append(label) switchingLabels.append(label)
} }
var lineGeoJson = FeatureCollection(features: switchingLines) let lineGeoJson = FeatureCollection(features: switchingLines)
var labelGeoJson = FeatureCollection(features: switchingLabels) let labelGeoJson = FeatureCollection(features: switchingLabels)
try self.mapView.mapboxMap.style.updateGeoJSONSource(withId: ecaSwitchingLine.sourceId, geoJSON: .featureCollection(lineGeoJson)) try self.mapView.mapboxMap.style.updateGeoJSONSource(withId: ecaSwitchingLine.sourceId, geoJSON: .featureCollection(lineGeoJson))
try self.mapView.mapboxMap.style.updateGeoJSONSource(withId: ecaSwLineLabel.sourceId, geoJSON: .featureCollection(labelGeoJson)) try self.mapView.mapboxMap.style.updateGeoJSONSource(withId: ecaSwLineLabel.sourceId, geoJSON: .featureCollection(labelGeoJson))
}catch{} }catch{}
......
...@@ -14,17 +14,26 @@ struct EcaSettingView: View { ...@@ -14,17 +14,26 @@ struct EcaSettingView: View {
var body: some View { var body: some View {
VStack(spacing: 0){ VStack(spacing: 0){
SliderView(param: $edittingEca.swFinish, title: "Switching Finish - ECA") SwSliderView(data: $edittingEca, type: .Finish)
.padding(.horizontal, 30) .padding(.horizontal, 30)
.padding(.vertical, 17) .padding(.vertical, 17)
Divider() Divider()
SliderView(param: $edittingEca.swStart, title: "Switching Start - ECA") .frame(height: 1)
.background(ColorSet.LineColor04.color)
SwSliderView(data: $edittingEca, type: .Start)
.padding(.horizontal, 30) .padding(.horizontal, 30)
.padding(.vertical, 17) .padding(.vertical, 17)
Divider() Divider()
SliderView(param: $edittingEca.swNotice, title: "Switching Notice - ECA") .frame(height: 1)
.background(ColorSet.LineColor04.color)
SwSliderView(data: $edittingEca, type: .Notice)
.padding(.horizontal, 30) .padding(.horizontal, 30)
.padding(.vertical, 17) .padding(.vertical, 17)
Divider()
.frame(height: 1)
.background(ColorSet.LineColor04.color)
Button(action: { Button(action: {
...@@ -40,27 +49,63 @@ struct EcaSettingView: View { ...@@ -40,27 +49,63 @@ struct EcaSettingView: View {
.background(ColorSet.PrimaryActiveIcon.color) .background(ColorSet.PrimaryActiveIcon.color)
.cornerRadius(30) .cornerRadius(30)
.padding(.vertical, 20) .padding(.vertical, 20)
.disabled(!checkSwitchingDistance())
} }
} }
}
fileprivate struct SliderView: View { private func checkSwitchingDistance() -> Bool{
init(param: Binding<Float>, title: String, min: Float = 1, max: Float = 10) { let notice = edittingEca.swNotice
let start = edittingEca.swStart
let finish = edittingEca.swFinish
return notice > start && notice > finish && start > finish
}
struct SwSliderView: View {
@Binding var data : RegisteredEca
@Binding var param : Float
var type: SwType
var min : Float = 1
var max : Float = 10
init(data: Binding<RegisteredEca>, type: SwType) {
let thumb = UIImage(systemName: "circle.fill") let thumb = UIImage(systemName: "circle.fill")
UISlider.appearance().setThumbImage(thumb, for: .normal) UISlider.appearance().setThumbImage(thumb, for: .normal)
UISlider.appearance().maximumTrackTintColor = UIColor(ColorSet.Slidebar.color) UISlider.appearance().maximumTrackTintColor = UIColor(ColorSet.Slidebar.color)
self._param = param self._data = data
self.title = title self._param = type == .Notice ? data.swNotice : type == .Start ? data.swStart : data.swFinish
self.min = min self.type = type
self.max = max switch type{
case .Finish:
self.max = data.swStart.wrappedValue <= 2 ? 2 : data.swStart.wrappedValue - 1
case .Start:
self.min = data.swFinish.wrappedValue
self.max = data.swNotice.wrappedValue
case .Notice:
self.min = data.swStart.wrappedValue >= 9 ? 9 : data.swStart.wrappedValue + 1
}
}
enum SwType: String{
case Notice
case Start
case Finish
var title: String {
switch self {
case .Notice:
"Switching Notice - ECA"
case .Start:
"Switching Start - ECA"
case .Finish:
"Switching Finish - ECA"
}
}
} }
@Binding var param: Float
let title: String
var min : Float = 1
var max : Float = 10
var body: some View { var body: some View {
VStack(alignment: .leading){ VStack(alignment: .leading){
Text(title) Text(type.title)
.font(FontStyle.EmphasisText.font) .font(FontStyle.EmphasisText.font)
HStack(alignment: .bottom){ HStack(alignment: .bottom){
...@@ -74,7 +119,26 @@ fileprivate struct SliderView: View { ...@@ -74,7 +119,26 @@ fileprivate struct SliderView: View {
HStack(spacing: 9){ HStack(spacing: 9){
Button(action: { Button(action: {
switch type{
case .Finish:
break
case .Start:
if data.swFinish >= param - 1 && param > 2{
data.swFinish -= 1
}
if param <= 2{
return
}
case .Notice:
if data.swNotice - data.swStart <= 1{
data.swStart -= 1
if data.swStart <= data.swFinish{
data.swFinish = data.swStart - 1
}
}
}
param -= 1 param -= 1
}, label: { }, label: {
Image(systemName: "minus.circle") Image(systemName: "minus.circle")
.resizable() .resizable()
...@@ -82,10 +146,51 @@ fileprivate struct SliderView: View { ...@@ -82,10 +146,51 @@ fileprivate struct SliderView: View {
}) })
.disabled(param <= min) .disabled(param <= min)
Slider(value: $param, in: min...max, step: 1) Slider(value: $param, in: min...max, step: 1){_ in
if type == .Start{
if param == min{
param += 1
}
if param == max{
param -= 1
}
}else if type == .Notice{
if param <= data.swStart{
data.swStart = param - 1
if data.swStart <= data.swFinish{
data.swFinish = data.swStart - 1
}
}
}else if type == .Finish{
if param >= data.swStart{
data.swStart = param + 1
if data.swStart >= data.swNotice{
data.swNotice = data.swStart + 1
}
}
}
}
Button(action: { Button(action: {
switch type{
case .Finish:
if data.swStart - data.swFinish <= 1{
data.swStart += 1
if data.swStart >= data.swNotice{
data.swNotice = data.swStart + 1
}
}
case .Start:
if data.swNotice <= param + 1 && param < 9{
data.swNotice += 1
}
if param >= 9{
return
}
case .Notice:
break
}
param += 1 param += 1
}, label: { }, label: {
Image(systemName: "plus.circle") Image(systemName: "plus.circle")
...@@ -98,9 +203,11 @@ fileprivate struct SliderView: View { ...@@ -98,9 +203,11 @@ fileprivate struct SliderView: View {
} }
.tint(ColorSet.SlidebarActive.color) .tint(ColorSet.SlidebarActive.color)
.foregroundColor(ColorSet.SlidebarActive.color) .foregroundColor(ColorSet.SlidebarActive.color)
} }
.foregroundColor(ColorSet.Body.color) .foregroundColor(ColorSet.Body.color)
} }
}
} }
#Preview { #Preview {
......
...@@ -14,6 +14,8 @@ enum MenuPath: String, Hashable{ ...@@ -14,6 +14,8 @@ enum MenuPath: String, Hashable{
case ManualRADAR case ManualRADAR
case ManualJmarineNeCST case ManualJmarineNeCST
case Information case Information
case Setting
case GpsSelect
case Help case Help
case AboutApp case AboutApp
case ContactUs case ContactUs
...@@ -30,6 +32,10 @@ enum MenuPath: String, Hashable{ ...@@ -30,6 +32,10 @@ enum MenuPath: String, Hashable{
"J-marine NeCST" "J-marine NeCST"
case .Information: case .Information:
"Information" "Information"
case .Setting:
"Setting"
case .GpsSelect:
"Fuel Switching GPS Select"
case .Help: case .Help:
"Help" "Help"
case .AboutApp: case .AboutApp:
...@@ -79,21 +85,9 @@ struct MenuView: View { ...@@ -79,21 +85,9 @@ struct MenuView: View {
} }
Button{ Button{
path.append(.Help) path.append(.Setting)
}label: { }label: {
MenuContentView(content: .Help) MenuContentView(content: .Setting)
}
Button{
path.append(.AboutApp)
}label: {
MenuContentView(content: .AboutApp)
}
Button{
path.append(.ContactUs)
}label: {
MenuContentView(content: .ContactUs)
} }
Spacer() Spacer()
...@@ -105,6 +99,12 @@ struct MenuView: View { ...@@ -105,6 +99,12 @@ struct MenuView: View {
if goto == .Manual{ if goto == .Manual{
MenuManualView(path: $path) MenuManualView(path: $path)
.navigationBarHidden(true) .navigationBarHidden(true)
}else if goto == .Setting{
MenuSettingView(path: $path)
.navigationBarHidden(true)
}else if goto == .GpsSelect{
MenuGpsSelectView(path: $path)
.navigationBarHidden(true)
}else{ }else{
VStack(spacing: 0) { VStack(spacing: 0) {
MenuTitleView(path: $path, title: goto.title) MenuTitleView(path: $path, title: goto.title)
......
//
// MenuGpsSelectView.swift
// Sailassist
//
// Created by Mamoru Sugita on 2023/11/21.
//
import SwiftUI
struct MenuGpsSelectView: View {
@Binding var path : [MenuPath]
@State var selected : GpsSelect = .Mobile
enum GpsSelect: String, CaseIterable{
case Mobile
case Cloud
var title: String{
switch self {
case .Mobile:
"Mobile Phone GPS"
case .Cloud:
"Cloud GPS"
}
}
}
var body: some View {
VStack{
MenuTitleView(path: $path, title: MenuPath.Setting.title)
ForEach(GpsSelect.allCases, id:\.rawValue){ content in
SelectContentView(selected: $selected, content: content)
}
Spacer()
}
.background(ColorSet.BackgroundPrimary.color)
}
struct SelectContentView: View {
@Binding var selected : GpsSelect
var content : GpsSelect
var body: some View {
VStack(spacing: 0){
Button{
selected = content
}label:{
HStack {
Text(content.title)
.font(FontStyle.EmphasisText.font)
.foregroundColor(ColorSet.Body.color)
Spacer()
if selected == content{
Image(systemName: "checkmark.square.fill")
.resizable()
.frame(width: 22, height: 22)
}else{
Image(systemName: "square")
.resizable()
.frame(width: 22, height: 22)
}
}
.padding(.vertical, 17)
.padding(.horizontal, 30)
}
Divider()
.background(ColorSet.LineColor04.color)
}
}
}
}
#Preview {
MenuGpsSelectView(path: .constant([.Setting]))
}
//
// MenuSettingView.swift
// Sailassist
//
// Created by Mamoru Sugita on 2023/11/21.
//
import SwiftUI
struct MenuSettingView: View {
@Binding var path : [MenuPath]
var body: some View {
VStack{
MenuTitleView(path: $path, title: MenuPath.Setting.title)
Button{
path.append(.GpsSelect)
}label: {
MenuContentView(content: .GpsSelect)
}
Button{
path.append(.Help)
}label: {
MenuContentView(content: .Help)
}
Button{
path.append(.AboutApp)
}label: {
MenuContentView(content: .AboutApp)
}
Button{
path.append(.ContactUs)
}label: {
MenuContentView(content: .ContactUs)
}
Spacer()
}
.background(ColorSet.BackgroundPrimary.color)
}
}
#Preview {
MenuSettingView(path: .constant([.Setting]))
}
...@@ -89,6 +89,20 @@ struct CustomTabBar: View { ...@@ -89,6 +89,20 @@ struct CustomTabBar: View {
.frame(height: 50) .frame(height: 50)
} }
.background(ColorSet.BottomNav.color) .background(ColorSet.BottomNav.color)
.alert("", isPresented: $selectedTabModel.isShowChangeEmrMode) {
Button("Yes"){
if SharingData.message.mode == 0{
SharingData.message.mode = 1
}else{
SharingData.message.mode = 0
}
}
Button("No"){
}
} message: {
Text("Do you change an emargency mode?")
}
} }
} }
......
...@@ -10,4 +10,5 @@ import SwiftUI ...@@ -10,4 +10,5 @@ import SwiftUI
//@Observable //@Observable
class SelectedTabModel: ObservableObject { class SelectedTabModel: ObservableObject {
@Published var activeTab: Tab = .task @Published var activeTab: Tab = .task
@Published var isShowChangeEmrMode: Bool = false
} }
//
// WebView.swift
// Sailassist
//
// Created by Mamoru Sugita on 2023/11/22.
//
import SwiftUI
import WebKit
struct WebView: UIViewRepresentable {
@Binding var isLoading: Bool
var url : String
func makeUIView(context: Context) -> WKWebView {
let request = URLRequest(url: URL(string: url)!)
let webView = WKWebView()
webView.navigationDelegate = context.coordinator
webView.load(request)
return webView
}
func updateUIView(_ uiView: WKWebView, context: Context) {}
func makeCoordinator() -> Coordinator {
return Coordinator(owner: self)
}
class Coordinator: NSObject, WKNavigationDelegate {
private let owner: WebView
init(owner: WebView) {
self.owner = owner
super.init()
}
func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) {
owner.isLoading = true
}
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
owner.isLoading = false
}
}
}
#Preview {
WebView(isLoading: .constant(false), url: "https://ssv-canary-web.azurewebsites.net/login?ReturnUrl=%2F")
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment