aboutsummaryrefslogtreecommitdiff
path: root/iosApp/iosApp/Shared
diff options
context:
space:
mode:
Diffstat (limited to 'iosApp/iosApp/Shared')
-rw-r--r--iosApp/iosApp/Shared/Constants.swift19
-rw-r--r--iosApp/iosApp/Shared/MarkerTransformations.swift19
-rw-r--r--iosApp/iosApp/Shared/OfflineBanner.swift27
3 files changed, 65 insertions, 0 deletions
diff --git a/iosApp/iosApp/Shared/Constants.swift b/iosApp/iosApp/Shared/Constants.swift
new file mode 100644
index 0000000..de82b0b
--- /dev/null
+++ b/iosApp/iosApp/Shared/Constants.swift
@@ -0,0 +1,19 @@
+//
+// Constants.swift
+// iosApp
+//
+// Created by Ivan Avalos on 21/09/23.
+// Copyright © 2023 orgName. All rights reserved.
+//
+
+import Foundation
+import UIKit
+
+struct Constants {
+ static var markerSize = 14.0 * UIScreen.main.scale
+ static var vertexsize = 8.0 * UIScreen.main.scale
+ static var markerLabelTextSize = UIFont.smallSystemFontSize
+ static var geofenceLabelTextSize = UIFont.smallSystemFontSize
+ static var geofenceLineWidth = 4.0 * UIScreen.main.scale
+ static var reportLineWidth = 4.0 * UIScreen.main.scale
+}
diff --git a/iosApp/iosApp/Shared/MarkerTransformations.swift b/iosApp/iosApp/Shared/MarkerTransformations.swift
index 7291a58..57aa36e 100644
--- a/iosApp/iosApp/Shared/MarkerTransformations.swift
+++ b/iosApp/iosApp/Shared/MarkerTransformations.swift
@@ -51,4 +51,23 @@ class MarkerTransformations {
}
return imageName
}
+
+ static let STEP = Float.pi / 8
+
+ static func angleToImageName(rad: Float) -> String {
+ var imageName: String
+ switch rad {
+ case 0.0 ..< STEP: imageName = "Angle0"
+ case STEP ..< STEP * 3: imageName = "Angle45"
+ case STEP * 3 ..< STEP * 5: imageName = "Angle90"
+ case STEP * 5 ..< STEP * 7: imageName = "Angle135"
+ case STEP * 7 ..< STEP * 9: imageName = "Angle180"
+ case STEP * 9 ..< STEP * 11: imageName = "Angle225"
+ case STEP * 11 ..< STEP * 13: imageName = "Angle270"
+ case STEP * 13 ..< STEP * 15: imageName = "Angle315"
+ case STEP * 15 ..< STEP * 16: imageName = "Angle0"
+ default: imageName = angleToImageName(rad: Float.pi * 2 + rad)
+ }
+ return imageName
+ }
}
diff --git a/iosApp/iosApp/Shared/OfflineBanner.swift b/iosApp/iosApp/Shared/OfflineBanner.swift
new file mode 100644
index 0000000..f29ab7d
--- /dev/null
+++ b/iosApp/iosApp/Shared/OfflineBanner.swift
@@ -0,0 +1,27 @@
+//
+// OfflineBanner.swift
+// iosApp
+//
+// Created by Ivan Avalos on 17/09/23.
+// Copyright © 2023 orgName. All rights reserved.
+//
+
+import SwiftUI
+
+struct OfflineBanner: View {
+ var body: some View {
+ Group {
+ Text("offline")
+ .foregroundColor(.white)
+ .padding(5)
+ }
+ .frame(minWidth: 0, maxWidth: .infinity)
+ .background(Color.red)
+ }
+}
+
+struct OfflineBanner_Previews: PreviewProvider {
+ static var previews: some View {
+ OfflineBanner()
+ }
+}