diff --git a/Arrival-iOS2/AppData.swift b/Arrival-iOS2/AppData.swift index d8b194b..8a1b7c1 100644 --- a/Arrival-iOS2/AppData.swift +++ b/Arrival-iOS2/AppData.swift @@ -67,6 +67,7 @@ class AppData: NSObject, ObservableObject,CLLocationManagerDelegate { @Published var trainLeaveTimeType: TrainTimeType = .now @Published var leaveDate = Date() @Published var arriveDate = Date() + @Published var appMessage = "" let net = Alamofire.NetworkReachabilityManager(host: "api.arrival.city") private let locationManager = CLLocationManager() private var lat = 0.0 @@ -139,6 +140,7 @@ class AppData: NSObject, ObservableObject,CLLocationManagerDelegate { self.daysBetweenReviewAsk = Int(self.remoteConfig["daysBetweenReviewAsk"].stringValue!)! self.privacyPolicy = self.remoteConfig["privacyPolicyUrl"].stringValue! self.termsOfService = self.remoteConfig["termsOfServiceUrl"].stringValue! + self.appMessage = self.remoteConfig["inAppMessage"].stringValue! print(self.onboardingLoaded, "config onboarding loaded") diff --git a/Arrival-iOS2/Assets.xcassets/darkGrey.colorset/Contents.json b/Arrival-iOS2/Assets.xcassets/darkGrey.colorset/Contents.json new file mode 100644 index 0000000..8f2a607 --- /dev/null +++ b/Arrival-iOS2/Assets.xcassets/darkGrey.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x29", + "green" : "0x29", + "red" : "0x29" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Arrival-iOS2/HomeView.swift b/Arrival-iOS2/HomeView.swift index c90cf4b..e915367 100644 --- a/Arrival-iOS2/HomeView.swift +++ b/Arrival-iOS2/HomeView.swift @@ -164,52 +164,53 @@ struct HomeView: View { }.padding().edgesIgnoringSafeArea(.bottom) } Spacer() - Button (action: { - self.fromStationSearch = "" - if (self.appData.fromStation.id != "loading") { - self.timeModalDisplayed = true - } - - }) { - VStack(alignment: .center) { - if (self.appData.trainLeaveTimeType == .now) { - HStack { - Spacer() - Text("leave").font(.caption) - Spacer() - } - Text("now").font(.headline) - } else if (self.appData.trainLeaveTimeType == .leave) { - HStack { - Spacer() - Text("leave").font(.caption) - Spacer() - } - Text(self.formateTime(self.appData.leaveDate)).font(.headline).lineLimit(1) - } else { - HStack { - Spacer() - Text("arrive").font(.caption) - Spacer() - } - Text(self.formateTime(self.appData.arriveDate)).font(.headline).lineLimit(1) + if (false) { + Button (action: { + self.fromStationSearch = "" + if (self.appData.fromStation.id != "loading") { + self.timeModalDisplayed = true } - }.multilineTextAlignment(.center).frame(width: geometry.size.width / 4) - }.frame(width: geometry.size.width / 4).sheet(isPresented: self.$timeModalDisplayed) { - VStack(alignment: .leading) { - HStack(alignment: .center) { - Text("Choose a time") - .font(.largeTitle) - .fontWeight(.bold) - Spacer() - Button(action: { - self.timeModalDisplayed = false - }) { - Text("Close") + }) { + VStack(alignment: .center) { + if (self.appData.trainLeaveTimeType == .now) { + HStack { + Spacer() + Text("leave").font(.caption) + Spacer() + } + Text("now").font(.headline) + } else if (self.appData.trainLeaveTimeType == .leave) { + HStack { + Spacer() + Text("leave").font(.caption) + Spacer() + } + Text(self.formateTime(self.appData.leaveDate)).font(.headline).lineLimit(1) + } else { + HStack { + Spacer() + Text("arrive").font(.caption) + Spacer() + } + Text(self.formateTime(self.appData.arriveDate)).font(.headline).lineLimit(1) } - } - + + }.multilineTextAlignment(.center).frame(width: geometry.size.width / 4) + }.frame(width: geometry.size.width / 4).sheet(isPresented: self.$timeModalDisplayed) { + VStack(alignment: .leading) { + HStack(alignment: .center) { + Text("Choose a time") + .font(.largeTitle) + .fontWeight(.bold) + Spacer() + Button(action: { + self.timeModalDisplayed = false + }) { + Text("Close") + } + } + Button(action: { self.appData.trainLeaveTimeType = .now }) { @@ -268,10 +269,11 @@ struct HomeView: View { } - - Spacer() - - }.padding() + + Spacer() + + }.padding() + } } Spacer() Button (action: { @@ -346,7 +348,16 @@ struct HomeView: View { Spacer() }.background(Color.red) } - + if (!self.appData.appMessage.isEmpty) { + HStack { + Spacer() + Text(self.appData.appMessage) + .font(.callout) + .foregroundColor(Color.white).padding() + Spacer() + + }.background(Color("darkGrey")) + } if (self.appData.fromStation.abbr != "load" || !self.locationTimeout && self.appData.locationAcess) { TrainView()