diff --git a/.DS_Store b/.DS_Store index be4a7c6ed08093a76031a3135bdf6f7e0dcd86ad..fdfa471846ee393ed5670fdeb85cf3ee7956eb1e 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/TraccarClient.xcodeproj/project.pbxproj b/TraccarClient.xcodeproj/project.pbxproj index c8befd0ec26b972734b9db0dad227d94032ffef8..a3796814281821d3bed9e0908b4e69fe1b5aebfd 100644 --- a/TraccarClient.xcodeproj/project.pbxproj +++ b/TraccarClient.xcodeproj/project.pbxproj @@ -7,6 +7,14 @@ objects = { /* Begin PBXBuildFile section */ + 5300802E2AF149D400A05E04 /* SettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5300802C2AF149D400A05E04 /* SettingsViewController.swift */; }; + 5300802F2AF149D400A05E04 /* SettingsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5300802D2AF149D400A05E04 /* SettingsViewController.xib */; }; + 530080332AF14E4400A05E04 /* CustomHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 530080312AF14E4300A05E04 /* CustomHeaderView.swift */; }; + 530080342AF14E4400A05E04 /* CustomHeaderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 530080322AF14E4300A05E04 /* CustomHeaderView.xib */; }; + 530080382AF15CE000A05E04 /* TransactionsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 530080362AF15CE000A05E04 /* TransactionsViewController.swift */; }; + 530080392AF15CE000A05E04 /* TransactionsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 530080372AF15CE000A05E04 /* TransactionsViewController.xib */; }; + 5300803D2AF1803100A05E04 /* TransactionTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5300803B2AF1803100A05E04 /* TransactionTableViewCell.swift */; }; + 5300803E2AF1803100A05E04 /* TransactionTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5300803C2AF1803100A05E04 /* TransactionTableViewCell.xib */; }; 53157EC32AEE3FF9003C9B6A /* API+Auth.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53157EC22AEE3FF9003C9B6A /* API+Auth.swift */; }; 53157EC62AEE4076003C9B6A /* UserModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53157EC52AEE4076003C9B6A /* UserModel.swift */; }; 53157EC82AEE4D6E003C9B6A /* SignInModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53157EC72AEE4D6E003C9B6A /* SignInModel.swift */; }; @@ -162,6 +170,14 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 5300802C2AF149D400A05E04 /* SettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsViewController.swift; sourceTree = "<group>"; }; + 5300802D2AF149D400A05E04 /* SettingsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SettingsViewController.xib; sourceTree = "<group>"; }; + 530080312AF14E4300A05E04 /* CustomHeaderView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomHeaderView.swift; sourceTree = "<group>"; }; + 530080322AF14E4300A05E04 /* CustomHeaderView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CustomHeaderView.xib; sourceTree = "<group>"; }; + 530080362AF15CE000A05E04 /* TransactionsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionsViewController.swift; sourceTree = "<group>"; }; + 530080372AF15CE000A05E04 /* TransactionsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TransactionsViewController.xib; sourceTree = "<group>"; }; + 5300803B2AF1803100A05E04 /* TransactionTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionTableViewCell.swift; sourceTree = "<group>"; }; + 5300803C2AF1803100A05E04 /* TransactionTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TransactionTableViewCell.xib; sourceTree = "<group>"; }; 53157EC22AEE3FF9003C9B6A /* API+Auth.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "API+Auth.swift"; sourceTree = "<group>"; }; 53157EC52AEE4076003C9B6A /* UserModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserModel.swift; sourceTree = "<group>"; }; 53157EC72AEE4D6E003C9B6A /* SignInModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignInModel.swift; sourceTree = "<group>"; }; @@ -348,6 +364,43 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 5300802B2AF149C500A05E04 /* SettingsViewController */ = { + isa = PBXGroup; + children = ( + 5300802C2AF149D400A05E04 /* SettingsViewController.swift */, + 5300802D2AF149D400A05E04 /* SettingsViewController.xib */, + ); + path = SettingsViewController; + sourceTree = "<group>"; + }; + 530080302AF14E4300A05E04 /* CustomHeaderView */ = { + isa = PBXGroup; + children = ( + 530080312AF14E4300A05E04 /* CustomHeaderView.swift */, + 530080322AF14E4300A05E04 /* CustomHeaderView.xib */, + ); + path = CustomHeaderView; + sourceTree = "<group>"; + }; + 530080352AF15CC400A05E04 /* TransactionsViewController */ = { + isa = PBXGroup; + children = ( + 5300803A2AF1801100A05E04 /* Cells */, + 530080362AF15CE000A05E04 /* TransactionsViewController.swift */, + 530080372AF15CE000A05E04 /* TransactionsViewController.xib */, + ); + path = TransactionsViewController; + sourceTree = "<group>"; + }; + 5300803A2AF1801100A05E04 /* Cells */ = { + isa = PBXGroup; + children = ( + 5300803B2AF1803100A05E04 /* TransactionTableViewCell.swift */, + 5300803C2AF1803100A05E04 /* TransactionTableViewCell.xib */, + ); + path = Cells; + sourceTree = "<group>"; + }; 53157EC42AEE4059003C9B6A /* Models */ = { isa = PBXGroup; children = ( @@ -537,6 +590,8 @@ 532683C42AEA5DB000A364C0 /* Controllers */ = { isa = PBXGroup; children = ( + 530080352AF15CC400A05E04 /* TransactionsViewController */, + 5300802B2AF149C500A05E04 /* SettingsViewController */, 53F10AF12AF0F267004D0529 /* MainViewController */, 53D62E3C2AEFA2F800C80BAC /* InitialViewController */, 532683B62AEA505C00A364C0 /* LoginViewController */, @@ -549,6 +604,7 @@ 532683C52AEA5DDF00A364C0 /* Custom */ = { isa = PBXGroup; children = ( + 530080302AF14E4300A05E04 /* CustomHeaderView */, 53157ECD2AEE563C003C9B6A /* KNSpinner */, 532683842AE9293200A364C0 /* KNComponentView.swift */, 532683822AE928F900A364C0 /* KNTableViewCell.swift */, @@ -824,16 +880,20 @@ 532683782AE923A500A364C0 /* FieldTableViewCell.xib in Resources */, 5326835D2AE91A6F00A364C0 /* Montserrat-Bold.ttf in Resources */, 53554AE32AED1B480018BAEE /* KNButtonView.xib in Resources */, + 5300803E2AF1803100A05E04 /* TransactionTableViewCell.xib in Resources */, 532683542AE91A6F00A364C0 /* Montserrat-LightItalic.ttf in Resources */, 53F10AF52AF0F306004D0529 /* ConnectViewController.xib in Resources */, + 5300802F2AF149D400A05E04 /* SettingsViewController.xib in Resources */, 5326835C2AE91A6F00A364C0 /* Montserrat-ThinItalic.ttf in Resources */, 53157ED12AEE563C003C9B6A /* KNSpinnerView.xib in Resources */, 532683562AE91A6F00A364C0 /* Montserrat-MediumItalic.ttf in Resources */, + 530080342AF14E4400A05E04 /* CustomHeaderView.xib in Resources */, 5326835A2AE91A6F00A364C0 /* Montserrat-Thin.ttf in Resources */, 532683602AE91A6F00A364C0 /* Montserrat-Medium.ttf in Resources */, 53157ED72AEE5751003C9B6A /* KNAlertViewController.xib in Resources */, 5370B4702AEFB8A900AE08CC /* splash.json in Resources */, 532683512AE91A6F00A364C0 /* Montserrat-ExtraLightItalic.ttf in Resources */, + 530080392AF15CE000A05E04 /* TransactionsViewController.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -871,6 +931,7 @@ files = ( 53157EC32AEE3FF9003C9B6A /* API+Auth.swift in Sources */, 5326833C2AE9175900A364C0 /* LoginViewController.swift in Sources */, + 530080382AF15CE000A05E04 /* TransactionsViewController.swift in Sources */, 532683962AE9482300A364C0 /* Network+Endpoint.swift in Sources */, CB7ED0801F6602CD00A33FCF /* Position.swift in Sources */, 532683972AE9482300A364C0 /* Network+Result.swift in Sources */, @@ -882,6 +943,7 @@ 5326839C2AE9482300A364C0 /* Network+Error.swift in Sources */, 532683AF2AE94C2F00A364C0 /* NSLayoutConstraints.swift in Sources */, CB7ED0821F661B4F00A33FCF /* PositionProvider.swift in Sources */, + 5300803D2AF1803100A05E04 /* TransactionTableViewCell.swift in Sources */, 53554AE52AED1BF10018BAEE /* UIButton.swift in Sources */, 53554AE02AED1B480018BAEE /* KNButtonViewHelper.swift in Sources */, 53157EDC2AEE5841003C9B6A /* UIWindow.swift in Sources */, @@ -935,6 +997,7 @@ 532683792AE923A500A364C0 /* FieldTableViewCell.swift in Sources */, 5326838B2AE92CA500A364C0 /* JSONField.swift in Sources */, 532683BF2AEA50EF00A364C0 /* LoginDataProvider.swift in Sources */, + 5300802E2AF149D400A05E04 /* SettingsViewController.swift in Sources */, 53F10AEE2AF06785004D0529 /* UITextField.swift in Sources */, 532683892AE92B6800A364C0 /* Observable.swift in Sources */, 53F10AE42AF05E68004D0529 /* AuthenticationStep.swift in Sources */, @@ -945,6 +1008,7 @@ 5E716A291F63A45A00A2DBC3 /* RequestManager.swift in Sources */, 532683C32AEA537F00A364C0 /* UITableView.swift in Sources */, 5326839B2AE9482300A364C0 /* NetworkRequest.swift in Sources */, + 530080332AF14E4400A05E04 /* CustomHeaderView.swift in Sources */, CB4197931F674A3E008F301C /* DatabaseHelper.swift in Sources */, 53F10AF42AF0F306004D0529 /* ConnectViewController.swift in Sources */, ); diff --git a/TraccarClient.xcodeproj/project.xcworkspace/xcuserdata/g.makhoul.xcuserdatad/UserInterfaceState.xcuserstate b/TraccarClient.xcodeproj/project.xcworkspace/xcuserdata/g.makhoul.xcuserdatad/UserInterfaceState.xcuserstate index 8a1f03e5d991331a6485087c84605cabedc4218c..9a0325a4f13560960b785151b6ec2f8aadb4d29d 100644 Binary files a/TraccarClient.xcodeproj/project.xcworkspace/xcuserdata/g.makhoul.xcuserdatad/UserInterfaceState.xcuserstate and b/TraccarClient.xcodeproj/project.xcworkspace/xcuserdata/g.makhoul.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/TraccarClient/AppDelegate.swift b/TraccarClient/AppDelegate.swift index dff0a86fe4de5950d08e5a08b2f5fad2c93d7148..f79098350a4470a0f99175dc712f85c06609f921 100644 --- a/TraccarClient/AppDelegate.swift +++ b/TraccarClient/AppDelegate.swift @@ -109,7 +109,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, PositionProviderDelegate case "org.traccar.client.start": if !userDefaults.bool(forKey: "service_status_preference") { userDefaults.setValue(true, forKey: "service_status_preference") - StatusViewController.addMessage(NSLocalizedString("Service created", comment: "")) + TransactionsViewController.addMessage(NSLocalizedString("Service created", comment: "")) trackingController = TrackingController() trackingController?.start() showToast(message: NSLocalizedString("Service created", comment: "")) @@ -117,7 +117,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, PositionProviderDelegate case "org.traccar.client.stop": if userDefaults.bool(forKey: "service_status_preference") { userDefaults.setValue(false, forKey: "service_status_preference") - StatusViewController.addMessage(NSLocalizedString("Service destroyed", comment: "")) + TransactionsViewController.addMessage(NSLocalizedString("Service destroyed", comment: "")) trackingController?.stop() trackingController = nil showToast(message: NSLocalizedString("Service destroyed", comment: "")) @@ -160,9 +160,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate, PositionProviderDelegate } func applicationWillTerminate(_ application: UIApplication) { + trackingController?.stop() + trackingController = nil let userDefaults = UserDefaults.standard - userDefaults.setValue(false, forKey: "service_status_preference") - + userDefaults.set(false, forKey: "service_status_preference") + if let context = managedObjectContext { if context.hasChanges { try! context.save() diff --git a/TraccarClient/Custom/CustomHeaderView/CustomHeaderView.swift b/TraccarClient/Custom/CustomHeaderView/CustomHeaderView.swift new file mode 100644 index 0000000000000000000000000000000000000000..1727ba51fa93da04542c1ae6181cc9e2d360a9f7 --- /dev/null +++ b/TraccarClient/Custom/CustomHeaderView/CustomHeaderView.swift @@ -0,0 +1,134 @@ +// +// AuthenticationHeaderView.swift +// opa +// +// Created by George Makhoul on 2/16/22. +// + +import UIKit + +protocol CustomHeaderViewDelegate { + func rightButtonTapped(action: RightButtonAction) + func leftButtonTapped(action: LeftButtonAction) +} + +enum HeaderType { + case home + case settings + case status +} + +enum RightButtonAction { + case goSettings + case back + case nothing +} + +enum LeftButtonAction { + case goStatus + case apply + case clear + case nothing +} + +final class CustomHeaderView: KNComponentView { + + // MARK: - Outlets + @IBOutlet private weak var view: UIView! + @IBOutlet private weak var boxView: UIView! + @IBOutlet private weak var button: UIButton! + @IBOutlet private weak var rightButton: UIButton! + @IBOutlet private weak var backgroundImage: UIImageView! + @IBOutlet private weak var titleLabel: UILabel! + + // MARK: - Properties + private var delegate: CustomHeaderViewDelegate? + private var headerType: HeaderType? + private var buttonAction: RightButtonAction = .nothing + private var leftButtonAction: LeftButtonAction = .nothing + + // MARK: - Lifecycle + override func setupNib() { + super.setupNib() + + view.frame = bounds + view.autoresizingMask = [.flexibleHeight, .flexibleWidth] + + setupUI() + } + + // MARK: - UI + private func setupUI() { + view.backgroundColor = .clear + titleLabel.set(text: "", color: .main, font: .semibold(20)) + titleLabel.textAlignment = .center + backgroundColor = .clear + boxView.backgroundColor = .clear + button.addTarget(self, action: #selector(buttonTapped), for: .touchUpInside) + rightButton.addTarget(self, action: #selector(leftButtonTapped), for: .touchUpInside) + } + + private func setHomeType() { + self.buttonAction = .goSettings + self.leftButtonAction = .goStatus + + button.set(title: "") + rightButton.set(title: "") + + button.set(icon: .menu) + rightButton.set(icon: .status) + } + + private func setSettingsType() { + self.buttonAction = .back + self.leftButtonAction = .apply + + titleLabel.set(text: "Settings") + titleLabel.textAlignment = .center + + button.set(title: "") + rightButton.set(title: "") + + button.set(icon: .back) + rightButton.set(icon: .apply) + } + + private func setStatusType() { + self.buttonAction = .back + self.leftButtonAction = .clear + + titleLabel.set(text: "Transactions") + titleLabel.textAlignment = .center + + button.set(title: "") + rightButton.set(title: "") + + button.set(icon: .back) + rightButton.set(icon: .bin) + + } + + func set(type: HeaderType, delegate: CustomHeaderViewDelegate) { + switch type { + case .home: + setHomeType() + + case .settings: + setSettingsType() + + case .status: + setStatusType() + } + + self.delegate = delegate + } + + // MARK: - Methods + @objc private func buttonTapped() { + delegate?.leftButtonTapped(action: self.leftButtonAction) + } + + @objc private func leftButtonTapped() { + delegate?.rightButtonTapped(action: self.buttonAction) + } +} diff --git a/TraccarClient/Custom/CustomHeaderView/CustomHeaderView.xib b/TraccarClient/Custom/CustomHeaderView/CustomHeaderView.xib new file mode 100644 index 0000000000000000000000000000000000000000..a75b047a8d872e9067fe6aff50a81c336fe9e92c --- /dev/null +++ b/TraccarClient/Custom/CustomHeaderView/CustomHeaderView.xib @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="UTF-8"?> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22155" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> + <device id="retina6_1" orientation="portrait" appearance="light"/> + <dependencies> + <deployment identifier="iOS"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/> + <capability name="Safe area layout guides" minToolsVersion="9.0"/> + <capability name="System colors in document resources" minToolsVersion="11.0"/> + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> + </dependencies> + <objects> + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="CustomHeaderView" customModule="TraccarClient" customModuleProvider="target"> + <connections> + <outlet property="boxView" destination="9cO-qA-W5u" id="Q1y-jE-f8y"/> + <outlet property="button" destination="meS-9V-arN" id="amL-Ke-tfX"/> + <outlet property="rightButton" destination="yRd-iH-B3p" id="AT2-zM-jQ8"/> + <outlet property="titleLabel" destination="xp0-E6-HVi" id="dqT-3T-vSo"/> + <outlet property="view" destination="iN0-l3-epB" id="u7i-fW-swr"/> + </connections> + </placeholder> + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> + <view contentMode="scaleToFill" id="iN0-l3-epB"> + <rect key="frame" x="0.0" y="0.0" width="414" height="106"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <subviews> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9cO-qA-W5u"> + <rect key="frame" x="0.0" y="0.0" width="414" height="106"/> + <subviews> + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="meS-9V-arN"> + <rect key="frame" x="16" y="50" width="40" height="40"/> + <constraints> + <constraint firstAttribute="height" constant="40" id="QPc-qP-prb"/> + <constraint firstAttribute="width" constant="40" id="rh7-tc-wKp"/> + </constraints> + </button> + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="yRd-iH-B3p"> + <rect key="frame" x="358" y="50" width="40" height="40"/> + <constraints> + <constraint firstAttribute="width" constant="40" id="eth-W9-VXr"/> + <constraint firstAttribute="height" constant="40" id="gmO-IF-EqX"/> + </constraints> + </button> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xp0-E6-HVi"> + <rect key="frame" x="66" y="70" width="282" height="0.0"/> + <fontDescription key="fontDescription" type="system" pointSize="17"/> + <nil key="textColor"/> + <nil key="highlightedColor"/> + </label> + </subviews> + <color key="backgroundColor" systemColor="systemBackgroundColor"/> + <constraints> + <constraint firstAttribute="bottom" secondItem="yRd-iH-B3p" secondAttribute="bottom" constant="16" id="4qs-3r-hXf"/> + <constraint firstItem="meS-9V-arN" firstAttribute="leading" secondItem="9cO-qA-W5u" secondAttribute="leading" constant="16" id="5WF-9E-VUl"/> + <constraint firstAttribute="bottom" secondItem="meS-9V-arN" secondAttribute="bottom" constant="16" id="68y-vd-FBc"/> + <constraint firstAttribute="trailing" secondItem="yRd-iH-B3p" secondAttribute="trailing" constant="16" id="V2q-2F-vU0"/> + <constraint firstItem="yRd-iH-B3p" firstAttribute="leading" secondItem="xp0-E6-HVi" secondAttribute="trailing" constant="10" id="i9h-wO-2Kn"/> + <constraint firstItem="xp0-E6-HVi" firstAttribute="centerY" secondItem="meS-9V-arN" secondAttribute="centerY" id="mf7-VW-aLQ"/> + <constraint firstItem="xp0-E6-HVi" firstAttribute="leading" secondItem="meS-9V-arN" secondAttribute="trailing" constant="10" id="v2C-pv-FW3"/> + </constraints> + </view> + </subviews> + <viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/> + <color key="backgroundColor" systemColor="systemBackgroundColor"/> + <constraints> + <constraint firstItem="9cO-qA-W5u" firstAttribute="trailing" secondItem="vUN-kp-3ea" secondAttribute="trailing" id="A0G-86-BF9"/> + <constraint firstItem="9cO-qA-W5u" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="Cw9-Nr-IWR"/> + <constraint firstAttribute="bottom" secondItem="9cO-qA-W5u" secondAttribute="bottom" id="EVS-Gw-DTO"/> + <constraint firstItem="9cO-qA-W5u" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="P6d-yM-eoC"/> + </constraints> + <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> + <point key="canvasLocation" x="137.68115942028987" y="-135.26785714285714"/> + </view> + </objects> + <resources> + <systemColor name="systemBackgroundColor"> + <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> + </systemColor> + </resources> +</document> diff --git a/TraccarClient/Images.xcassets/.DS_Store b/TraccarClient/Images.xcassets/.DS_Store index e473d4f10f5fd7d90e926cfa5d4813cb9f5d28e8..b7f788c837f88ef2cf6586e8cb95f602abadb157 100644 Binary files a/TraccarClient/Images.xcassets/.DS_Store and b/TraccarClient/Images.xcassets/.DS_Store differ diff --git a/TraccarClient/Images.xcassets/apply.imageset/Contents.json b/TraccarClient/Images.xcassets/apply.imageset/Contents.json new file mode 100644 index 0000000000000000000000000000000000000000..61be4e15632abd5b263d8427b4fc33541c65cac3 --- /dev/null +++ b/TraccarClient/Images.xcassets/apply.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "icons8-check-mark-24.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "icons8-check-mark-48.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "icons8-check-mark-96.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/TraccarClient/Images.xcassets/apply.imageset/icons8-check-mark-24.png b/TraccarClient/Images.xcassets/apply.imageset/icons8-check-mark-24.png new file mode 100644 index 0000000000000000000000000000000000000000..0a207968888c64e7f2e526f4366bb1431a025d7f Binary files /dev/null and b/TraccarClient/Images.xcassets/apply.imageset/icons8-check-mark-24.png differ diff --git a/TraccarClient/Images.xcassets/apply.imageset/icons8-check-mark-48.png b/TraccarClient/Images.xcassets/apply.imageset/icons8-check-mark-48.png new file mode 100644 index 0000000000000000000000000000000000000000..6fea238e86b30c9ad2bfc0dd92f359b4c8d8e73a Binary files /dev/null and b/TraccarClient/Images.xcassets/apply.imageset/icons8-check-mark-48.png differ diff --git a/TraccarClient/Images.xcassets/apply.imageset/icons8-check-mark-96.png b/TraccarClient/Images.xcassets/apply.imageset/icons8-check-mark-96.png new file mode 100644 index 0000000000000000000000000000000000000000..2b011bd5993588d22e9452eb8306aada5205d9fd Binary files /dev/null and b/TraccarClient/Images.xcassets/apply.imageset/icons8-check-mark-96.png differ diff --git a/TraccarClient/Images.xcassets/back.imageset/Contents.json b/TraccarClient/Images.xcassets/back.imageset/Contents.json new file mode 100644 index 0000000000000000000000000000000000000000..2a67fbe7b24ebbb8927bf88ec94c8b6bde9e1c51 --- /dev/null +++ b/TraccarClient/Images.xcassets/back.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "icons8-back-24.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "icons8-back-48.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "icons8-back-96.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/TraccarClient/Images.xcassets/back.imageset/icons8-back-24.png b/TraccarClient/Images.xcassets/back.imageset/icons8-back-24.png new file mode 100644 index 0000000000000000000000000000000000000000..2bf78e71b7fb889a2cf467d011e091fd7abf5e1f Binary files /dev/null and b/TraccarClient/Images.xcassets/back.imageset/icons8-back-24.png differ diff --git a/TraccarClient/Images.xcassets/back.imageset/icons8-back-48.png b/TraccarClient/Images.xcassets/back.imageset/icons8-back-48.png new file mode 100644 index 0000000000000000000000000000000000000000..99f57d8c746d233f2d2094ecb0aec58a9628e354 Binary files /dev/null and b/TraccarClient/Images.xcassets/back.imageset/icons8-back-48.png differ diff --git a/TraccarClient/Images.xcassets/back.imageset/icons8-back-96.png b/TraccarClient/Images.xcassets/back.imageset/icons8-back-96.png new file mode 100644 index 0000000000000000000000000000000000000000..205ee4ffdfa4b24d9a34f47b7dacbca10a93d15a Binary files /dev/null and b/TraccarClient/Images.xcassets/back.imageset/icons8-back-96.png differ diff --git a/TraccarClient/Images.xcassets/bin.imageset/Contents.json b/TraccarClient/Images.xcassets/bin.imageset/Contents.json new file mode 100644 index 0000000000000000000000000000000000000000..7c91aa12c46b5ab8e69f0486e14c33ec7dcc9b0a --- /dev/null +++ b/TraccarClient/Images.xcassets/bin.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "icons8-bin-24.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "icons8-bin-48.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "icons8-bin-96.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/TraccarClient/Images.xcassets/bin.imageset/icons8-bin-24.png b/TraccarClient/Images.xcassets/bin.imageset/icons8-bin-24.png new file mode 100644 index 0000000000000000000000000000000000000000..89fd18015b840f0ac646c459a110aff1edc09da0 Binary files /dev/null and b/TraccarClient/Images.xcassets/bin.imageset/icons8-bin-24.png differ diff --git a/TraccarClient/Images.xcassets/bin.imageset/icons8-bin-48.png b/TraccarClient/Images.xcassets/bin.imageset/icons8-bin-48.png new file mode 100644 index 0000000000000000000000000000000000000000..0295b03713cd06dc091a6da1d6c50217a25e011e Binary files /dev/null and b/TraccarClient/Images.xcassets/bin.imageset/icons8-bin-48.png differ diff --git a/TraccarClient/Images.xcassets/bin.imageset/icons8-bin-96.png b/TraccarClient/Images.xcassets/bin.imageset/icons8-bin-96.png new file mode 100644 index 0000000000000000000000000000000000000000..97be706bfa11d4883c7ef84c516ef86bcc9eb850 Binary files /dev/null and b/TraccarClient/Images.xcassets/bin.imageset/icons8-bin-96.png differ diff --git a/TraccarClient/Images.xcassets/menu.imageset/Contents.json b/TraccarClient/Images.xcassets/menu.imageset/Contents.json new file mode 100644 index 0000000000000000000000000000000000000000..3df27edcf00bdb41b07b53faf198ace805f74c12 --- /dev/null +++ b/TraccarClient/Images.xcassets/menu.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "icons8-settings-50.pdf", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "icons8-settings-100.pdf", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "icons8-settings-150.pdf", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/TraccarClient/Images.xcassets/menu.imageset/icons8-settings-100.pdf b/TraccarClient/Images.xcassets/menu.imageset/icons8-settings-100.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f02e2db72f442b17af0f5166bd9489f531b9fe87 Binary files /dev/null and b/TraccarClient/Images.xcassets/menu.imageset/icons8-settings-100.pdf differ diff --git a/TraccarClient/Images.xcassets/menu.imageset/icons8-settings-150.pdf b/TraccarClient/Images.xcassets/menu.imageset/icons8-settings-150.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fa7e8c8a0a1f44c185fec4ad7f66ccf13b608652 Binary files /dev/null and b/TraccarClient/Images.xcassets/menu.imageset/icons8-settings-150.pdf differ diff --git a/TraccarClient/Images.xcassets/menu.imageset/icons8-settings-50.pdf b/TraccarClient/Images.xcassets/menu.imageset/icons8-settings-50.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6c66c86151ee2ed77027e2d43528dcdef44be040 Binary files /dev/null and b/TraccarClient/Images.xcassets/menu.imageset/icons8-settings-50.pdf differ diff --git a/TraccarClient/Images.xcassets/nmoLogo.imageset/Contents.json b/TraccarClient/Images.xcassets/nmoLogo.imageset/Contents.json index 834da7f296a4b0144ffb253c19d5fefc98ebf452..560e401428e887ab66de2bd75cf05121e1af8284 100644 --- a/TraccarClient/Images.xcassets/nmoLogo.imageset/Contents.json +++ b/TraccarClient/Images.xcassets/nmoLogo.imageset/Contents.json @@ -1,15 +1,17 @@ { "images" : [ { + "filename" : "nmoLogo.png", "idiom" : "universal", "scale" : "1x" }, { + "filename" : "nmoLogo2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "nmoAiLogo.pdf", + "filename" : "nmoLogo3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/TraccarClient/Images.xcassets/nmoLogo.imageset/nmoAiLogo.pdf b/TraccarClient/Images.xcassets/nmoLogo.imageset/nmoAiLogo.pdf deleted file mode 100644 index 1c7ffdd4a7b407b6f4358e5703c2924554c169fc..0000000000000000000000000000000000000000 --- a/TraccarClient/Images.xcassets/nmoLogo.imageset/nmoAiLogo.pdf +++ /dev/null @@ -1,523 +0,0 @@ -%PDF-1.7 - -1 0 obj - << >> -endobj - -2 0 obj - << /Length 3 0 R >> -stream -/DeviceRGB CS -/DeviceRGB cs -q -1.000000 0.000000 -0.000000 1.000000 9.889221 65.726501 cm -0.000000 0.000000 0.000000 scn -28.289259 25.178450 m -28.333239 25.102062 28.377218 25.102062 28.421198 25.178450 c -31.783325 30.969532 35.126415 36.742985 38.450470 42.498810 c -39.057648 43.550606 39.849937 44.861923 40.827332 46.432762 c -41.772560 47.951698 42.872372 48.911438 44.759876 48.911438 c -52.226532 48.911438 59.693180 48.911438 67.159836 48.911438 c -68.332512 48.911438 69.437248 48.471722 69.793678 47.295551 c -70.186539 45.999901 68.999100 44.384014 68.374847 43.317528 c -60.715542 30.226877 53.157646 17.078444 45.492432 3.990730 c -43.154957 -0.000023 37.709057 0.079304 35.381432 4.009338 c -33.043304 7.956020 30.733068 11.924580 28.450735 15.915005 c -28.443670 15.927208 28.433701 15.937508 28.421715 15.944988 c -28.409727 15.952465 28.396099 15.956890 28.382051 15.957859 c -28.368004 15.958832 28.353973 15.956318 28.341215 15.950550 c -28.328459 15.944778 28.317375 15.935932 28.308952 15.924801 c -28.223619 15.811852 28.135004 15.675396 28.043106 15.515438 c -26.025305 12.033607 24.002907 8.554714 21.975916 5.078758 c -20.766809 3.005527 19.525211 1.366138 16.919924 1.095844 c -16.405956 1.042305 15.536214 1.008678 14.310698 0.994968 c -10.806129 0.954491 7.301562 0.961674 3.796993 1.016518 c -2.711949 1.033165 1.482167 0.856888 0.673799 1.707920 c --0.319676 2.756779 -0.091247 3.807598 0.565491 4.942638 c -5.747841 13.887802 10.942991 22.825129 16.150942 31.754623 c -17.270447 33.675083 18.117214 35.270405 20.661455 35.102940 c -22.000530 35.014801 22.995975 34.176498 23.681267 33.033623 c -25.254025 30.410988 26.790022 27.792599 28.289259 25.178450 c -h -44.840614 44.499573 m -40.212933 36.557240 35.629555 28.616865 31.025501 20.630461 c -31.011417 20.606022 31.004000 20.578402 31.004000 20.550381 c -31.004000 20.522360 31.011417 20.494925 31.025501 20.470829 c -34.021355 15.316311 37.003090 10.176811 39.970715 5.052322 c -40.094776 4.838177 40.221138 4.614559 40.349796 4.381481 c -40.355457 4.370941 40.363827 4.362091 40.374054 4.355820 c -40.384281 4.349548 40.396000 4.346081 40.408009 4.345783 c -40.420021 4.345486 40.431896 4.348362 40.442425 4.354115 c -40.452957 4.359871 40.461758 4.368301 40.467945 4.378544 c -42.037418 6.933609 43.508434 9.531757 45.011936 12.123055 c -51.276707 22.919146 57.548367 33.726986 63.826920 44.546581 c -63.831612 44.554817 63.834076 44.564137 63.834072 44.573601 c -63.834068 44.583065 63.831596 44.592339 63.826900 44.600483 c -63.822208 44.608627 63.815456 44.615360 63.807335 44.619995 c -63.799213 44.624634 63.790005 44.627007 63.780640 44.626884 c -45.062153 44.626884 l -45.017246 44.626858 44.973133 44.615078 44.934246 44.592731 c -44.895359 44.570385 44.863071 44.538258 44.840614 44.499573 c -h -6.095081 5.276585 m -9.683014 5.243290 13.257819 5.245247 16.819494 5.282463 c -16.844648 5.282742 16.869314 5.289570 16.891069 5.302277 c -16.912823 5.314983 16.930912 5.333130 16.943554 5.354931 c -19.766769 10.254173 22.604101 15.144928 25.455542 20.027195 c -25.635725 20.336662 25.710558 20.557009 25.514620 20.895857 c -23.794827 23.878883 22.068140 26.858322 20.334564 29.834167 c -20.329636 29.842804 20.322498 29.849966 20.313860 29.854944 c -20.305222 29.859922 20.295387 29.862541 20.285330 29.862541 c -20.275272 29.862541 20.265345 29.859922 20.256535 29.854944 c -20.247726 29.849966 20.240343 29.842804 20.235119 29.834167 c -6.051758 5.351017 l -6.047479 5.343449 6.045257 5.334904 6.045311 5.326221 c -6.045366 5.317539 6.047694 5.309021 6.052068 5.301506 c -6.056441 5.293991 6.062710 5.287739 6.070253 5.283371 c -6.077796 5.278999 6.086353 5.276661 6.095081 5.276585 c -h -f -n -Q -q -1.000000 0.000000 -0.000000 1.000000 121.956116 61.554810 cm -0.000000 0.000000 0.000000 scn -11.015539 4.624681 m -5.515640 2.890245 -0.343581 7.152311 0.015734 12.890951 c -0.532869 21.130749 11.795703 23.457382 15.897054 16.300995 c -18.518463 11.728124 15.934778 6.176752 11.015539 4.624681 c -h -8.470775 7.588645 m -9.745420 7.593040 10.966049 8.106825 11.864154 9.016968 c -12.762259 9.927112 13.264263 11.159060 13.259730 12.441803 c -13.257486 13.076952 13.130956 13.705456 12.887355 14.291424 c -12.643754 14.877394 12.287865 15.409353 11.839993 15.856934 c -11.392123 16.304514 10.861045 16.658945 10.277088 16.899996 c -9.693131 17.141047 9.067735 17.263996 8.436594 17.261820 c -7.161949 17.257423 5.941308 16.743643 5.043203 15.833500 c -4.145098 14.923356 3.643093 13.691404 3.647626 12.408662 c -3.649870 11.773512 3.776402 11.145010 4.020002 10.559040 c -4.263602 9.973071 4.619504 9.441113 5.067375 8.993534 c -5.515246 8.545954 6.046312 8.191522 6.630268 7.950471 c -7.214225 7.709420 7.839634 7.586469 8.470775 7.588645 c -h -f -n -Q -q -1.000000 0.000000 -0.000000 1.000000 79.760864 66.237793 cm -0.000000 0.000000 0.000000 scn -3.679535 13.451571 m -3.686775 13.338743 3.720997 13.330264 3.782205 13.426135 c -4.775366 14.988432 6.538576 15.728984 8.345220 15.732897 c -10.539847 15.736810 12.434350 14.880824 13.467000 12.887110 c -14.102781 11.658403 14.206442 10.347521 14.208416 8.981855 c -14.213681 6.055525 14.216316 3.112890 14.216316 0.153950 c -14.216316 0.129302 14.206433 0.105663 14.188845 0.088235 c -14.171256 0.070806 14.147401 0.061013 14.122527 0.061013 c -10.584272 0.055144 l -10.570658 0.055144 10.557596 0.060398 10.547969 0.069755 c -10.538342 0.079111 10.532934 0.091805 10.532934 0.105037 c -10.511215 3.024846 10.504963 5.934872 10.514176 8.835115 c -10.518126 10.126431 10.232815 11.283725 9.076759 11.984166 c -8.187259 12.522215 7.024292 12.578953 6.034093 12.242428 c -4.413050 11.690683 3.737779 10.370022 3.720009 8.725550 c -3.689075 5.849437 3.674926 2.958974 3.677558 0.054165 c -3.677560 0.047658 3.676250 0.041218 3.673708 0.035219 c -3.671166 0.029220 3.667442 0.023784 3.662754 0.019229 c -3.658065 0.014674 3.652503 0.011090 3.646400 0.008691 c -3.640297 0.006290 3.633773 0.005121 3.627208 0.005251 c -2.468192 0.042425 1.297657 0.042098 0.115605 0.004272 c -0.104598 0.003878 0.093624 0.005689 0.083338 0.009592 c -0.073052 0.013495 0.063666 0.019412 0.055740 0.026991 c -0.047815 0.034571 0.041514 0.043657 0.037212 0.053705 c -0.032910 0.063752 0.030697 0.074555 0.030704 0.085470 c -0.026755 3.573980 0.017868 7.069339 0.004047 10.571545 c --0.000889 11.900035 0.027744 13.525919 0.001088 15.004085 c --0.004835 15.331805 0.000103 15.455068 0.379202 15.426698 c -0.581256 15.411046 0.783966 15.408112 0.987337 15.417893 c -1.860055 15.460938 2.702495 15.453437 3.514662 15.395392 c -3.635763 15.386914 3.693028 15.322675 3.686446 15.202673 c -3.650248 14.545928 3.647943 13.962228 3.679535 13.451571 c -h -f -n -Q -q -1.000000 0.000000 -0.000000 1.000000 97.001953 66.072205 cm -0.000000 0.000000 0.000000 scn -12.106738 13.399842 m -12.118659 13.392098 12.132051 13.386855 12.146087 13.384436 c -12.160121 13.382016 12.174508 13.382473 12.188359 13.385775 c -12.202211 13.389075 12.215237 13.395153 12.226637 13.403634 c -12.238037 13.412115 12.247563 13.422820 12.254646 13.435093 c -12.927791 14.589161 13.908911 15.326119 15.198009 15.645968 c -16.895004 16.067974 18.653139 16.016081 20.120386 15.066324 c -22.199970 13.719041 22.542128 11.381855 22.534239 9.104397 c -22.524378 6.157213 22.507284 3.210030 22.482962 0.262847 c -22.482719 0.249168 22.477354 0.236117 22.467978 0.226439 c -22.458599 0.216763 22.445950 0.211210 22.432684 0.210950 c -19.007130 0.169828 l -18.989923 0.169518 18.972853 0.172787 18.956959 0.179432 c -18.941067 0.186077 18.926706 0.195957 18.914770 0.208451 c -18.902836 0.220946 18.893572 0.235788 18.887579 0.252053 c -18.881586 0.268319 18.878990 0.285658 18.879936 0.302988 c -18.892756 0.510564 18.851339 0.743599 18.854298 0.941383 c -18.897684 3.825902 18.940083 6.671257 18.778370 9.618441 c -18.728081 10.530991 18.475655 11.395563 17.783447 11.996749 c -16.656389 12.975880 15.042212 12.798656 14.014747 11.729445 c -13.047429 10.722898 13.029683 9.409885 13.031655 7.880483 c -13.033628 6.350101 13.033627 4.821679 13.055320 3.292277 c -13.070439 2.267454 13.022126 1.244913 12.910373 0.224659 c -12.908912 0.211174 12.902563 0.198705 12.892547 0.189663 c -12.882530 0.180621 12.869552 0.175647 12.856135 0.175702 c -9.439475 0.212910 l -9.425694 0.213161 9.412545 0.218710 9.402799 0.228388 c -9.393052 0.238067 9.387464 0.251116 9.387211 0.264801 c -9.341195 2.975035 9.347764 5.660467 9.406927 8.321093 c -9.445383 10.034571 9.142669 12.469668 6.921094 12.580310 c -5.649744 12.643627 4.723189 12.152103 4.141419 11.105740 c -3.646420 10.213751 3.670076 9.428488 3.663174 8.191846 c -3.650027 5.556679 3.636889 2.921512 3.623741 0.286345 c -3.623741 0.279787 3.622486 0.273292 3.620058 0.267233 c -3.617630 0.261174 3.614073 0.255669 3.609586 0.251032 c -3.605099 0.246395 3.599776 0.242719 3.593914 0.240209 c -3.588052 0.237700 3.581759 0.236408 3.575414 0.236408 c -0.130154 0.194306 l -0.118806 0.194177 0.107550 0.196309 0.097028 0.200582 c -0.086507 0.204853 0.076933 0.211177 0.068862 0.219191 c -0.060792 0.227205 0.054374 0.236749 0.050001 0.247267 c -0.045627 0.257785 0.043381 0.269073 0.043381 0.280470 c -0.000000 15.412934 l -0.000000 15.436337 0.004631 15.459511 0.013650 15.481132 c -0.022668 15.502752 0.035888 15.522397 0.052553 15.538944 c -0.069217 15.555492 0.089001 15.568616 0.110774 15.577572 c -0.132548 15.586527 0.155889 15.591137 0.179456 15.591137 c -3.434415 15.591137 l -3.481692 15.591162 3.527107 15.572961 3.560994 15.540409 c -3.594881 15.507856 3.614561 15.463525 3.615845 15.416852 c -3.667122 13.657354 l -3.671066 13.532025 3.705912 13.530067 3.771649 13.651480 c -4.651207 15.260191 6.185499 15.882918 7.981100 15.894669 c -9.686970 15.906418 11.098007 14.999743 11.958831 13.572170 c -12.008790 13.489270 12.058093 13.431828 12.106738 13.399842 c -h -f -n -Q -q -1.000000 0.000000 -0.000000 1.000000 152.959839 75.769958 cm -0.000000 0.000000 0.000000 scn -1.209899 -0.000006 m -1.878109 -0.000006 2.419798 0.507829 2.419798 1.134276 c -2.419798 1.760722 1.878109 2.268555 1.209899 2.268555 c -0.541689 2.268555 0.000000 1.760722 0.000000 1.134276 c -0.000000 0.507829 0.541689 -0.000006 1.209899 -0.000006 c -h -f -n -Q -q -1.000000 0.000000 -0.000000 1.000000 142.524414 65.460449 cm -0.000000 0.000000 0.000000 scn -6.958498 1.760666 m -6.961141 1.827145 6.939000 1.836272 6.892084 1.788043 c -5.934606 0.797387 4.758741 0.442510 3.364484 0.723413 c --0.280079 1.458583 -1.030404 5.952703 1.440603 8.318544 c -2.884750 9.700900 5.528224 9.844612 6.868297 8.259890 c -6.967414 8.142575 7.008051 8.159516 6.990210 8.310722 c -6.909918 8.995056 l -6.892738 9.138440 6.955515 9.210461 7.098245 9.211112 c -8.808027 9.216000 l -8.823079 9.216128 8.838004 9.213293 8.851948 9.207651 c -8.865891 9.202010 8.878585 9.193677 8.889275 9.183133 c -8.899964 9.172590 8.908444 9.160045 8.914235 9.146222 c -8.920026 9.132399 8.923007 9.117573 8.923007 9.102598 c -8.892275 0.865169 l -8.892267 0.858409 8.891006 0.851717 8.888548 0.845484 c -8.886091 0.839252 8.882496 0.833600 8.877974 0.828866 c -8.873451 0.824133 8.868091 0.820413 8.862208 0.817917 c -8.856325 0.815421 8.850033 0.814199 8.843708 0.814331 c -6.972363 0.836821 l -6.965765 0.836934 6.959267 0.838399 6.953234 0.841128 c -6.947201 0.843858 6.941763 0.847793 6.937239 0.852710 c -6.932715 0.857627 6.929189 0.863427 6.926882 0.869763 c -6.924574 0.876100 6.923526 0.882846 6.923797 0.889609 c -6.958498 1.760666 l -h -4.651721 2.463910 m -4.984127 2.482813 5.309412 2.567626 5.609009 2.713500 c -5.908606 2.859375 6.176650 3.063452 6.397826 3.314088 c -6.619002 3.564725 6.788990 3.857008 6.898073 4.174250 c -7.007157 4.491492 7.053202 4.827478 7.033586 5.163028 c -6.993969 5.840700 6.689293 6.475453 6.186583 6.927643 c -5.683873 7.379833 5.024300 7.612421 4.352976 7.574243 c -4.020569 7.555339 3.695285 7.470527 3.395688 7.324653 c -3.096091 7.178778 2.828060 6.974701 2.606883 6.724064 c -2.385707 6.473427 2.215719 6.181145 2.106636 5.863903 c -1.997553 5.546660 1.951507 5.210674 1.971123 4.875124 c -2.010740 4.197452 2.315415 3.562699 2.818126 3.110509 c -3.320836 2.658319 3.980397 2.425731 4.651721 2.463910 c -h -f -n -Q -q -1.000000 0.000000 -0.000000 1.000000 153.111023 66.224426 cm -0.000000 0.000000 0.000000 scn -1.188121 0.089630 m -0.845249 0.077963 0.477835 0.053984 0.085885 0.017688 c -0.079239 0.017148 0.072550 0.017925 0.066239 0.019979 c -0.059928 0.022032 0.054132 0.025317 0.049227 0.029615 c -0.044322 0.033914 0.040411 0.039135 0.037744 0.044949 c -0.035077 0.050761 0.033713 0.057036 0.033737 0.063378 c -0.000000 8.334813 l -0.000092 8.357801 0.009012 8.379938 0.025050 8.396981 c -0.041088 8.414025 0.063114 8.424778 0.086908 8.427173 c -0.758337 8.491986 1.388524 8.503976 1.977472 8.463143 c -1.995065 8.461782 2.011554 8.454456 2.023941 8.442500 c -2.036328 8.430544 2.043792 8.414748 2.044959 8.398003 c -2.100855 7.628672 2.124366 6.882029 2.115505 6.158068 c -2.090965 4.203956 2.094034 2.247899 2.078697 0.292815 c -2.077333 0.155412 2.004737 0.082822 1.860908 0.075045 c -1.635962 0.063378 1.387504 0.096435 1.188121 0.089630 c -h -f -n -Q -q -1.000000 0.000000 -0.000000 1.000000 135.113770 50.239502 cm -0.000000 0.000000 0.000000 scn -4.332519 1.357412 m -1.696231 1.333972 l -1.672828 1.333706 1.649673 1.325538 1.629807 1.310544 c -1.609941 1.295551 1.594296 1.274432 1.584937 1.249972 c -1.257012 0.404159 l -1.211302 0.285002 1.119216 0.221189 0.980760 0.212725 c -0.153013 0.164867 l -0.009920 0.156403 -0.032813 0.221842 0.024822 0.361184 c -2.443495 6.207669 l -2.459521 6.246005 2.483502 6.280954 2.514044 6.310471 c -2.544586 6.339987 2.581068 6.363479 2.621359 6.379568 c -3.136095 6.584673 3.490190 6.457380 3.683630 5.997683 c -4.456066 4.163453 5.241084 2.284618 6.038693 0.361184 c -6.046862 0.341335 6.050473 0.319957 6.049270 0.298579 c -6.048068 0.277200 6.042087 0.256349 6.031743 0.237505 c -6.021398 0.218662 6.006953 0.202295 5.989432 0.189571 c -5.971912 0.176847 5.951747 0.168076 5.930383 0.163890 c -5.685270 0.117660 5.402726 0.110174 5.082755 0.141428 c -4.927737 0.157055 4.829032 0.238446 4.786634 0.385601 c -4.693889 0.708561 4.567363 1.017521 4.407046 1.312482 c -4.399570 1.326048 4.388698 1.337386 4.375581 1.345293 c -4.362463 1.353200 4.347588 1.357388 4.332519 1.357412 c -h -2.028123 2.347781 m -2.023411 2.336388 2.021609 2.324027 2.022883 2.311792 c -2.024158 2.299558 2.028474 2.287817 2.035438 2.277599 c -2.042402 2.267380 2.051802 2.258996 2.062828 2.253181 c -2.073854 2.247366 2.086159 2.244304 2.098672 2.244251 c -3.933050 2.237414 l -3.945646 2.237306 3.958076 2.240257 3.969234 2.246004 c -3.980392 2.251751 3.989933 2.260113 3.997012 2.270356 c -4.004090 2.280598 4.008486 2.292403 4.009809 2.304717 c -4.011132 2.317029 4.009338 2.329473 4.004593 2.340943 c -3.095356 4.572685 l -3.089679 4.586645 3.079878 4.598610 3.067214 4.607039 c -3.054549 4.615469 3.039605 4.619976 3.024310 4.619976 c -3.009014 4.619976 2.994070 4.615469 2.981405 4.607039 c -2.968741 4.598610 2.958941 4.586645 2.953264 4.572685 c -2.028123 2.347781 l -h -f -n -Q -q -1.000000 0.000000 -0.000000 1.000000 150.237549 49.961853 cm -0.000000 0.000000 0.000000 scn -1.316243 3.443716 m -0.366053 3.767904 0.027942 5.038213 0.484578 5.829585 c -1.184105 7.041130 2.853247 6.931436 3.903509 6.235067 c -3.921693 6.223088 3.937257 6.207486 3.949241 6.189222 c -3.961226 6.170959 3.969388 6.150419 3.973210 6.128863 c -3.977032 6.107307 3.976434 6.085195 3.971467 6.063878 c -3.966500 6.042560 3.957261 6.022492 3.944319 6.004905 c -3.810243 5.822080 3.656087 5.678429 3.481853 5.573957 c -3.452133 5.556102 3.418246 5.546590 3.383724 5.546417 c -3.349203 5.546245 3.315312 5.555418 3.285595 5.572977 c -2.818273 5.851133 1.858367 6.110683 1.452253 5.588651 c -0.877086 4.848208 2.659913 4.153800 3.108776 4.003948 c -4.933375 3.394748 4.769183 0.769897 2.831882 0.451584 c -1.840238 0.289001 0.955460 0.511984 0.177560 1.120531 c --0.241185 1.448637 0.174650 1.812978 0.462234 1.973603 c -0.588537 2.044122 0.703186 2.028453 0.806171 1.926593 c -1.368708 1.370282 2.480167 0.825721 3.090310 1.679777 c -3.762633 2.621001 1.906955 3.242934 1.316243 3.443716 c -h -f -n -Q -q -1.000000 0.000000 -0.000000 1.000000 142.524414 50.296021 cm -0.000000 0.000000 0.000000 scn -5.219440 4.179065 m -4.652850 3.148113 4.011464 2.140057 3.295284 1.154896 c -3.284713 1.140182 3.270642 1.128266 3.254307 1.120202 c -3.237972 1.112138 3.219887 1.108176 3.201634 1.108661 c -3.183381 1.109146 3.165525 1.114061 3.149652 1.122981 c -3.133779 1.131901 3.120369 1.144547 3.110614 1.159801 c -1.222212 4.112341 l -1.152050 4.221585 1.116631 4.212102 1.115969 4.083888 c -1.093136 0.227628 l -1.092883 0.203517 1.084746 0.180226 1.070011 0.161401 c -1.055276 0.142577 1.034771 0.129285 1.011715 0.123617 c -0.733053 0.057547 0.423615 0.074885 0.083397 0.175625 c -0.059284 0.182796 0.038159 0.197451 0.023137 0.217422 c -0.008115 0.237394 -0.000001 0.261620 0.000000 0.286505 c -0.005963 6.233772 l -0.006014 6.248657 0.010255 6.263146 0.018180 6.275503 c -0.026104 6.287860 0.037370 6.297561 0.050637 6.303442 c -0.311427 6.419228 0.599350 6.443758 0.914417 6.377034 c -0.947663 6.370236 0.979254 6.356631 1.007254 6.337058 c -1.035255 6.317484 1.059075 6.292353 1.077247 6.263207 c -3.111608 3.051626 l -3.188389 2.931261 3.265508 2.931917 3.342951 3.053591 c -5.378306 6.254380 l -5.395798 6.281249 5.420642 6.302394 5.449789 6.315216 c -5.786036 6.458477 6.122287 6.451933 6.458534 6.295590 c -6.471844 6.289442 6.483105 6.279627 6.491015 6.267292 c -6.498926 6.254957 6.503155 6.240608 6.503208 6.225920 c -6.503208 0.239402 l -6.503141 0.219820 6.496643 0.200759 6.484664 0.185034 c -6.472686 0.169309 6.455858 0.157756 6.436682 0.152077 c -6.111025 0.056570 5.770816 0.040537 5.416035 0.103991 c -5.402335 0.106518 5.389958 0.113794 5.381070 0.124551 c -5.372181 0.135308 5.367343 0.148869 5.367386 0.162869 c -5.365401 1.299139 5.378307 4.230086 5.291928 4.232049 c -5.279098 4.232037 5.265542 4.227088 5.252757 4.217741 c -5.239972 4.208395 5.228442 4.195014 5.219440 4.179065 c -h -f -n -Q -q -1.000000 0.000000 -0.000000 1.000000 124.073425 50.326477 cm -0.000000 0.000000 0.000000 scn -0.359116 5.695424 m -0.042952 5.737637 -0.043367 5.901578 0.018862 6.192157 c -0.042951 6.305379 0.114213 6.362316 0.232649 6.362970 c -4.565596 6.387512 l -4.580573 6.387451 4.595070 6.382706 4.606861 6.374013 c -4.618652 6.365319 4.627083 6.353161 4.630839 6.339410 c -4.698421 6.094643 4.706449 5.884886 4.654926 5.710146 c -4.643048 5.670670 4.617739 5.635938 4.582700 5.611031 c -4.547662 5.586123 4.504729 5.572350 4.460204 5.571731 c -3.106223 5.556026 l -3.059875 5.555486 3.015588 5.535829 2.982918 5.501304 c -2.950247 5.466779 2.931812 5.420151 2.931581 5.371469 c -2.882401 0.129258 l -2.882441 0.115131 2.877455 0.101429 2.868299 0.090503 c -2.859143 0.079578 2.846387 0.072111 2.832217 0.069376 c -2.483600 0.000004 2.147023 0.037310 1.822495 0.181290 c -1.809014 0.187479 1.797608 0.197499 1.789611 0.210188 c -1.781613 0.222878 1.777359 0.237711 1.777334 0.252952 c -1.783356 1.856374 1.801762 3.459467 1.832542 5.062235 c -1.835219 5.216687 1.826855 5.348235 1.807450 5.456875 c -1.801808 5.489129 1.785117 5.518548 1.760132 5.540310 c -1.735147 5.562072 1.703352 5.574881 1.669944 5.576638 c -1.226312 5.598889 0.789365 5.638486 0.359116 5.695424 c -h -f -n -Q -q -1.000000 0.000000 -0.000000 1.000000 130.122925 50.322998 cm -0.000000 0.000000 0.000000 scn -3.920699 0.821025 m -3.939731 0.820701 3.958411 0.814934 3.974696 0.804343 c -3.990980 0.793753 4.004254 0.778745 4.013083 0.760948 c -4.103840 0.576445 4.106754 0.377168 4.021832 0.163118 c -4.012613 0.139789 3.996883 0.119755 3.976630 0.105554 c -3.956378 0.091353 3.932510 0.083623 3.908057 0.083343 c -0.076829 0.039021 l -0.066659 0.039022 0.056585 0.041043 0.047201 0.044966 c -0.037817 0.048889 0.029302 0.054638 0.022156 0.061876 c -0.015010 0.069114 0.009376 0.077696 0.005573 0.087130 c -0.001770 0.096563 -0.000122 0.106656 0.000006 0.116826 c -0.024316 6.311791 l -0.024319 6.324683 0.029410 6.337059 0.038501 6.346266 c -0.047591 6.355474 0.059956 6.360778 0.072936 6.361036 c -1.208694 6.388613 2.344780 6.397150 3.481186 6.386644 c -3.740816 6.383689 3.983910 6.429978 4.035447 6.090191 c -4.056839 5.949023 4.023451 5.808839 3.935287 5.669641 c -3.927226 5.656926 3.916007 5.646411 3.902609 5.639025 c -3.889211 5.631639 3.874055 5.627609 3.858476 5.627291 c -1.377894 5.573123 l -1.199622 5.569184 1.111449 5.483500 1.113394 5.316069 c -1.132849 3.962829 l -1.133120 3.940956 1.142429 3.920048 1.158785 3.904586 c -1.175141 3.889124 1.197247 3.880335 1.220367 3.880096 c -3.594949 3.846607 l -3.625578 3.846123 3.655161 3.835048 3.678834 3.815186 c -3.702508 3.795324 3.718877 3.767854 3.725258 3.737285 c -3.768044 3.535711 3.766743 3.344318 3.721365 3.163098 c -3.710557 3.119444 3.685295 3.080657 3.649563 3.052845 c -3.613831 3.025033 3.569652 3.009767 3.523966 3.009449 c -1.204805 2.988771 l -1.188207 2.988511 1.172376 2.981443 1.160732 2.969096 c -1.149087 2.956748 1.142562 2.940116 1.142570 2.922785 c -1.148411 1.048534 l -1.148422 1.001764 1.166975 0.956865 1.200081 0.923517 c -1.233187 0.890170 1.278190 0.871046 1.325381 0.870269 c -3.920699 0.821025 l -h -f -n -Q - -endstream -endobj - -3 0 obj - 20776 -endobj - -4 0 obj - << /Annots [] - /Type /Page - /MediaBox [ 0.000000 0.000000 165.000000 165.000000 ] - /Resources 1 0 R - /Contents 2 0 R - /Parent 5 0 R - >> -endobj - -5 0 obj - << /Kids [ 4 0 R ] - /Count 1 - /Type /Pages - >> -endobj - -6 0 obj - << /Pages 5 0 R - /Type /Catalog - >> -endobj - -xref -0 7 -0000000000 65535 f -0000000010 00000 n -0000000034 00000 n -0000020866 00000 n -0000020890 00000 n -0000021065 00000 n -0000021139 00000 n -trailer -<< /ID [ (some) (id) ] - /Root 6 0 R - /Size 7 ->> -startxref -21198 -%%EOF \ No newline at end of file diff --git a/TraccarClient/Images.xcassets/nmoLogo.imageset/nmoLogo.png b/TraccarClient/Images.xcassets/nmoLogo.imageset/nmoLogo.png new file mode 100644 index 0000000000000000000000000000000000000000..7f0bc8d94c3acfb4d9dd2d85cad37f8e15c38739 Binary files /dev/null and b/TraccarClient/Images.xcassets/nmoLogo.imageset/nmoLogo.png differ diff --git a/TraccarClient/Images.xcassets/nmoLogo.imageset/nmoLogo2x.png b/TraccarClient/Images.xcassets/nmoLogo.imageset/nmoLogo2x.png new file mode 100644 index 0000000000000000000000000000000000000000..629cec33fdd67e82b13a3549f597f2998fb2b11e Binary files /dev/null and b/TraccarClient/Images.xcassets/nmoLogo.imageset/nmoLogo2x.png differ diff --git a/TraccarClient/Images.xcassets/nmoLogo.imageset/nmoLogo3x.png b/TraccarClient/Images.xcassets/nmoLogo.imageset/nmoLogo3x.png new file mode 100644 index 0000000000000000000000000000000000000000..f47658e8d9666b6c6a52a0efb1808def01a94655 Binary files /dev/null and b/TraccarClient/Images.xcassets/nmoLogo.imageset/nmoLogo3x.png differ diff --git a/TraccarClient/Images.xcassets/status.imageset/Contents.json b/TraccarClient/Images.xcassets/status.imageset/Contents.json new file mode 100644 index 0000000000000000000000000000000000000000..7c6c886ff5eda9697bd7da1fc82af03a66835153 --- /dev/null +++ b/TraccarClient/Images.xcassets/status.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "icons8-data-transfer-24.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "icons8-data-transfer-48.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "icons8-data-transfer-96.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/TraccarClient/Images.xcassets/status.imageset/icons8-data-transfer-24.png b/TraccarClient/Images.xcassets/status.imageset/icons8-data-transfer-24.png new file mode 100644 index 0000000000000000000000000000000000000000..a7356046666a33a2bd884690e4a47f09b9c816ae Binary files /dev/null and b/TraccarClient/Images.xcassets/status.imageset/icons8-data-transfer-24.png differ diff --git a/TraccarClient/Images.xcassets/status.imageset/icons8-data-transfer-48.png b/TraccarClient/Images.xcassets/status.imageset/icons8-data-transfer-48.png new file mode 100644 index 0000000000000000000000000000000000000000..a10bb2f8b9f5ea982a2f0c70f38b13ba58096936 Binary files /dev/null and b/TraccarClient/Images.xcassets/status.imageset/icons8-data-transfer-48.png differ diff --git a/TraccarClient/Images.xcassets/status.imageset/icons8-data-transfer-96.png b/TraccarClient/Images.xcassets/status.imageset/icons8-data-transfer-96.png new file mode 100644 index 0000000000000000000000000000000000000000..69ed3e73a80d66edd206479611730bef4e2a6aab Binary files /dev/null and b/TraccarClient/Images.xcassets/status.imageset/icons8-data-transfer-96.png differ diff --git a/TraccarClient/Images.xcassets/thumbDown.imageset/Contents.json b/TraccarClient/Images.xcassets/thumbDown.imageset/Contents.json new file mode 100644 index 0000000000000000000000000000000000000000..2335f608763b2ade0d6d063927a5a2ce7288d979 --- /dev/null +++ b/TraccarClient/Images.xcassets/thumbDown.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "icons8-thumbs-down-24.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "icons8-thumbs-down-48.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "icons8-thumbs-down-96.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/TraccarClient/Images.xcassets/thumbDown.imageset/icons8-thumbs-down-24.png b/TraccarClient/Images.xcassets/thumbDown.imageset/icons8-thumbs-down-24.png new file mode 100644 index 0000000000000000000000000000000000000000..1270c292784292e679dd4ab6e8506c406a407a27 Binary files /dev/null and b/TraccarClient/Images.xcassets/thumbDown.imageset/icons8-thumbs-down-24.png differ diff --git a/TraccarClient/Images.xcassets/thumbDown.imageset/icons8-thumbs-down-48.png b/TraccarClient/Images.xcassets/thumbDown.imageset/icons8-thumbs-down-48.png new file mode 100644 index 0000000000000000000000000000000000000000..81dcda4538a74ee2723036d7b7d1c592520df69f Binary files /dev/null and b/TraccarClient/Images.xcassets/thumbDown.imageset/icons8-thumbs-down-48.png differ diff --git a/TraccarClient/Images.xcassets/thumbDown.imageset/icons8-thumbs-down-96.png b/TraccarClient/Images.xcassets/thumbDown.imageset/icons8-thumbs-down-96.png new file mode 100644 index 0000000000000000000000000000000000000000..f11e069bd69894f73c00fb28a67625812a55d27d Binary files /dev/null and b/TraccarClient/Images.xcassets/thumbDown.imageset/icons8-thumbs-down-96.png differ diff --git a/TraccarClient/Images.xcassets/thumbsup.imageset/Contents.json b/TraccarClient/Images.xcassets/thumbsup.imageset/Contents.json new file mode 100644 index 0000000000000000000000000000000000000000..c5abe17740edc94f1d48297d3df8fbdfc4cd3c04 --- /dev/null +++ b/TraccarClient/Images.xcassets/thumbsup.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "icons8-thumbs-up-24.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "icons8-thumbs-up-48.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "icons8-thumbs-up-96.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/TraccarClient/Images.xcassets/thumbsup.imageset/icons8-thumbs-up-24.png b/TraccarClient/Images.xcassets/thumbsup.imageset/icons8-thumbs-up-24.png new file mode 100644 index 0000000000000000000000000000000000000000..c13fca4eb7cfb52c01766ed17a570c721a3093cd Binary files /dev/null and b/TraccarClient/Images.xcassets/thumbsup.imageset/icons8-thumbs-up-24.png differ diff --git a/TraccarClient/Images.xcassets/thumbsup.imageset/icons8-thumbs-up-48.png b/TraccarClient/Images.xcassets/thumbsup.imageset/icons8-thumbs-up-48.png new file mode 100644 index 0000000000000000000000000000000000000000..9d2e3ea3ad9b1419db8fd9e90c0e9cc845228257 Binary files /dev/null and b/TraccarClient/Images.xcassets/thumbsup.imageset/icons8-thumbs-up-48.png differ diff --git a/TraccarClient/Images.xcassets/thumbsup.imageset/icons8-thumbs-up-96.png b/TraccarClient/Images.xcassets/thumbsup.imageset/icons8-thumbs-up-96.png new file mode 100644 index 0000000000000000000000000000000000000000..f303dd1354128cc42fbdb2cbca666a68dbb28fe3 Binary files /dev/null and b/TraccarClient/Images.xcassets/thumbsup.imageset/icons8-thumbs-up-96.png differ diff --git a/TraccarClient/Images.xcassets/updated.imageset/Contents.json b/TraccarClient/Images.xcassets/updated.imageset/Contents.json new file mode 100644 index 0000000000000000000000000000000000000000..4241cb60bd4f1ec7f4b97d959927fd97a12b3820 --- /dev/null +++ b/TraccarClient/Images.xcassets/updated.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "icons8-update-done-24.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "icons8-update-done-48.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "icons8-update-done-96.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/TraccarClient/Images.xcassets/updated.imageset/icons8-update-done-24.png b/TraccarClient/Images.xcassets/updated.imageset/icons8-update-done-24.png new file mode 100644 index 0000000000000000000000000000000000000000..b69a6e0b7855640ce28be1b1a95b38839a68e238 Binary files /dev/null and b/TraccarClient/Images.xcassets/updated.imageset/icons8-update-done-24.png differ diff --git a/TraccarClient/Images.xcassets/updated.imageset/icons8-update-done-48.png b/TraccarClient/Images.xcassets/updated.imageset/icons8-update-done-48.png new file mode 100644 index 0000000000000000000000000000000000000000..acdb24a171b941f75464fa6392a8358d4ffbe4f2 Binary files /dev/null and b/TraccarClient/Images.xcassets/updated.imageset/icons8-update-done-48.png differ diff --git a/TraccarClient/Images.xcassets/updated.imageset/icons8-update-done-96.png b/TraccarClient/Images.xcassets/updated.imageset/icons8-update-done-96.png new file mode 100644 index 0000000000000000000000000000000000000000..d2af6e039a80337fca1aff4ed632e6459164d901 Binary files /dev/null and b/TraccarClient/Images.xcassets/updated.imageset/icons8-update-done-96.png differ diff --git a/TraccarClient/InitialViewController/InitialViewController.swift b/TraccarClient/InitialViewController/InitialViewController.swift index 4f3a5baae3be06d4bd0956b6863eeac63537fa64..41ed071998a168f65eeea71be6cc35ed99334837 100644 --- a/TraccarClient/InitialViewController/InitialViewController.swift +++ b/TraccarClient/InitialViewController/InitialViewController.swift @@ -52,14 +52,7 @@ extension InitialViewController { window?.makeKeyAndVisible() } else { -// let storyboard = UIStoryboard(name: "MainStoryboard", bundle: nil) -// if let mainViewController = storyboard.instantiateViewController(withIdentifier: "MainViewController") as? MainViewController { -// let navigation = KNNavigationController(rootViewController: mainViewController) -// navigation.modalPresentationStyle = .overFullScreen -// window?.rootViewController = navigation -// window?.makeKeyAndVisible() -// -// } + let connect = ConnectViewController() let navigation = KNNavigationController(rootViewController: connect) navigation.modalPresentationStyle = .overFullScreen diff --git a/TraccarClient/LoginViewController/Model/LoginModelController.swift b/TraccarClient/LoginViewController/Model/LoginModelController.swift index 682e181bfcc8ec79c53f2dbc44e556f3b5b21d89..15793ee51e5cc98dffd031f35bca941293f15b56 100644 --- a/TraccarClient/LoginViewController/Model/LoginModelController.swift +++ b/TraccarClient/LoginViewController/Model/LoginModelController.swift @@ -81,12 +81,6 @@ extension LoginModelController { guard let strongSelf = self else {return} if result.success { - // let storyboard = UIStoryboard(name: "MainStoryboard", bundle: nil) - // if let mainViewController = storyboard.instantiateViewController(withIdentifier: "MainViewController") as? MainViewController { - // strongSelf.viewController.navigationController?.pushViewController(mainViewController, animated: true) - // } - - let connect = ConnectViewController() strongSelf.viewController.navigationController?.pushViewController(connect, animated: true) diff --git a/TraccarClient/MainViewController/ConnectViewController.swift b/TraccarClient/MainViewController/ConnectViewController.swift index f14745e4da5779efcbaa55ea0fc3e27138cf202c..54edd3a180a2a3a66bca319666d292bb3c1b475c 100644 --- a/TraccarClient/MainViewController/ConnectViewController.swift +++ b/TraccarClient/MainViewController/ConnectViewController.swift @@ -11,33 +11,57 @@ import InAppSettingsKit final class ConnectViewController: KNViewController { // MARK: - Outlets + @IBOutlet weak var customHeaderView: CustomHeaderView! @IBOutlet weak var connectButton: UIButton! @IBOutlet private weak var connectionStatusLogo: UIImageView! @IBOutlet private weak var discLabel: UILabel! @IBOutlet private weak var statusLabel: UILabel! - @IBOutlet private weak var statusButton: UIButton! + @IBOutlet private weak var timerLabel: UILabel! // MARK: - Properties let userDefaults = UserDefaults.standard var trackingController: TrackingController? - + private lazy var totalTime = 0 + + private var timer: Timer? + private var isInBackground: Bool = false + private var currentBackgroundDate = Date() + // MARK: - LifeCycle override func viewDidLoad() { super.viewDidLoad() setupUI() } + deinit { + NotificationCenter.default.removeObserver(self, name: UIApplication.didEnterBackgroundNotification, object: nil) + NotificationCenter.default.removeObserver(self, name: UIApplication.didBecomeActiveNotification, object: nil) + } + private func setupUI() { - isBackButtonHidden = true - statusButton.set(title: "Status", color: .main, font: .medium(16)) + customHeaderView.set(type: .home, delegate: self) + timerLabel.text = "" connectButton.set(title: "") + discLabel.set(text: "We're currently tracking your journey. Drive safely!", color: .black, font: .medium(12)) discLabel.textAlignment = .center let status = userDefaults.bool(forKey: "service_status_preference") statusChanged(to: status) + + NotificationCenter.default.addObserver(self, selector: #selector(appInBackground), name: UIApplication.didEnterBackgroundNotification, object: nil) + + NotificationCenter.default.addObserver(self, selector: #selector(appResumed), name: UIApplication.willEnterForegroundNotification, object: nil) + } + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + hasCustomNavigation = true + } + + private func statusChanged(to: Bool) { + connectionStatusLogo.set(icon: to ? .connectedLogo : .disconnectedLogo) connectButton.set(icon: to ? .connectedButton : .disconnectedButton) statusLabel.set(text: to ? "You're on the map!" : "Tracking stopped.", color: .black, font: .bold(20)) @@ -48,26 +72,78 @@ final class ConnectViewController: KNViewController { @IBAction func connectTapped(_ sender: UIButton) { let status = userDefaults.bool(forKey: "service_status_preference") if status { + endTimer() userDefaults.set(false, forKey: "service_status_preference") statusChanged(to: false) - StatusViewController.addMessage(NSLocalizedString("Service destroyed", comment: "")) + TransactionsViewController.addMessage(NSLocalizedString("Service destroyed", comment: "")) AppDelegate.instance.trackingController?.stop() AppDelegate.instance.trackingController = nil } else { + startTimer() userDefaults.set(true, forKey: "service_status_preference") statusChanged(to: true) - StatusViewController.addMessage(NSLocalizedString("Service created", comment: "")) + TransactionsViewController.addMessage(NSLocalizedString("Service created", comment: "")) trackingController = TrackingController() trackingController?.start() } } +} + +// MARK: - Timer Methods +extension ConnectViewController { + func startTimer() { + timerLabel.set(text: "", color: .lightGray, font: .semibold(14)) + + timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(updateTime), userInfo: nil, repeats: true) + + RunLoop.current.add(timer!, forMode: RunLoop.Mode.common) + } - @IBAction func statusTapped(_ sender: UIButton) { - let storyboard = UIStoryboard(name: "MainStoryboard", bundle: nil) - if let statusViewController = storyboard.instantiateViewController(withIdentifier: "StatusViewController") as? StatusViewController { - self.navigationController?.pushViewController(statusViewController, animated: true) - } + @objc func updateTime() { + timeFormatted(totalTime) + totalTime += 1 + } + + @objc private func appInBackground() { + timer?.invalidate() + currentBackgroundDate = Date() + } + + @objc private func appResumed() { + let difference = currentBackgroundDate.timeIntervalSince(Date()) + print(currentBackgroundDate, difference, totalTime) + + let seconds = Int(abs(difference)) + totalTime += seconds + + timer = Timer.scheduledTimer(timeInterval: 1.0, target: self, selector: #selector(updateTime), userInfo: nil, repeats: true) + timer?.fire() + } + + func endTimer() { + timer?.invalidate() + timerLabel.set(text: "") + totalTime = 0 + } + + func timeFormatted(_ totalSeconds: Int) { + let seconds: Int = totalSeconds % 60 + let minutes: Int = (totalSeconds / 60) % 60 + let timerText = "\(String(format: "%02d:%02d", minutes, seconds))" + timerLabel.set(text: timerText, color: .lightGray, font: .semibold(14)) + } +} +extension ConnectViewController: CustomHeaderViewDelegate { + func rightButtonTapped(action: RightButtonAction) { + let transactions = TransactionsViewController() + self.navigationController?.pushViewController(transactions, animated: true) + + } + + func leftButtonTapped(action: LeftButtonAction) { + let settings = SettingsViewController() + self.navigationController?.pushViewController(settings, animated: true) } } diff --git a/TraccarClient/MainViewController/ConnectViewController.xib b/TraccarClient/MainViewController/ConnectViewController.xib index 9d75ac6fb69ef70d10777fb8b7065d73a2113ad6..d7f5552704ef78c63d1a1420c7aa457c7cbc3a6a 100644 --- a/TraccarClient/MainViewController/ConnectViewController.xib +++ b/TraccarClient/MainViewController/ConnectViewController.xib @@ -13,9 +13,10 @@ <connections> <outlet property="connectButton" destination="CkC-Ms-GkO" id="b3W-8l-sFQ"/> <outlet property="connectionStatusLogo" destination="zub-LG-NJa" id="WSa-Cl-2dv"/> + <outlet property="customHeaderView" destination="sRb-Ee-0gO" id="9Wm-RW-Xoy"/> <outlet property="discLabel" destination="GMM-3p-jRe" id="4fG-9o-848"/> - <outlet property="statusButton" destination="HS8-B5-jBo" id="vWq-SO-K1o"/> <outlet property="statusLabel" destination="3f0-IX-LtZ" id="2fh-ed-xJp"/> + <outlet property="timerLabel" destination="tx9-o4-hgS" id="p5k-Iq-GJH"/> <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> </connections> </placeholder> @@ -25,27 +26,27 @@ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="nmoLogo" translatesAutoresizingMaskIntoConstraints="NO" id="nK6-XO-h2t"> - <rect key="frame" x="114" y="0.0" width="165" height="165"/> + <rect key="frame" x="114" y="95" width="165" height="165"/> <constraints> <constraint firstAttribute="height" constant="165" id="nip-ho-zT0"/> <constraint firstAttribute="width" constant="165" id="pbW-5n-K0u"/> </constraints> </imageView> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="disconnectedLogo" translatesAutoresizingMaskIntoConstraints="NO" id="zub-LG-NJa"> - <rect key="frame" x="73" y="175" width="247" height="253"/> + <rect key="frame" x="73" y="270" width="247" height="253"/> <constraints> <constraint firstAttribute="height" constant="253" id="B4E-Zl-biZ"/> <constraint firstAttribute="width" constant="247" id="k8d-KL-54m"/> </constraints> </imageView> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GMM-3p-jRe"> - <rect key="frame" x="73" y="448" width="247" height="20.333333333333314"/> + <rect key="frame" x="73" y="543" width="247" height="20.333333333333371"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> <nil key="textColor"/> <nil key="highlightedColor"/> </label> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="CkC-Ms-GkO"> - <rect key="frame" x="114" y="518.33333333333337" width="165" height="165"/> + <rect key="frame" x="114" y="583.33333333333337" width="165" height="165"/> <constraints> <constraint firstAttribute="width" constant="165" id="9th-Vo-PUR"/> <constraint firstAttribute="height" constant="165" id="BmZ-pN-ikQ"/> @@ -57,7 +58,7 @@ </connections> </button> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3f0-IX-LtZ"> - <rect key="frame" x="170.33333333333334" y="723.33333333333337" width="52.333333333333343" height="24"/> + <rect key="frame" x="170.33333333333334" y="768.33333333333337" width="52.333333333333343" height="24"/> <constraints> <constraint firstAttribute="height" constant="24" id="htr-pN-8Wx"/> </constraints> @@ -65,32 +66,43 @@ <nil key="textColor"/> <nil key="highlightedColor"/> </label> - <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="HS8-B5-jBo"> - <rect key="frame" x="302" y="0.0" width="75" height="39"/> - <state key="normal" title="Button"/> - <buttonConfiguration key="configuration" style="plain" title="Button"/> - <connections> - <action selector="statusTapped:" destination="-1" eventType="touchUpInside" id="uDg-3P-81p"/> - </connections> - </button> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tx9-o4-hgS"> + <rect key="frame" x="179.33333333333334" y="802.33333333333337" width="34.333333333333343" height="24"/> + <constraints> + <constraint firstAttribute="height" constant="24" id="YrJ-sw-AgZ"/> + </constraints> + <fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="14"/> + <nil key="textColor"/> + <nil key="highlightedColor"/> + </label> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="sRb-Ee-0gO" customClass="CustomHeaderView" customModule="TraccarClient" customModuleProvider="target"> + <rect key="frame" x="0.0" y="0.0" width="393" height="95"/> + <color key="backgroundColor" systemColor="systemBackgroundColor"/> + <constraints> + <constraint firstAttribute="height" constant="95" id="9ID-fz-tzv"/> + </constraints> + </view> </subviews> <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/> <color key="backgroundColor" systemColor="systemBackgroundColor"/> <constraints> <constraint firstItem="3f0-IX-LtZ" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="2ff-id-KKY"/> <constraint firstItem="zub-LG-NJa" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="4fj-2R-IeS"/> - <constraint firstItem="nK6-XO-h2t" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="6o2-bx-S2k"/> + <constraint firstItem="tx9-o4-hgS" firstAttribute="top" secondItem="3f0-IX-LtZ" secondAttribute="bottom" constant="10" id="B0j-M3-qoh"/> <constraint firstItem="GMM-3p-jRe" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="ClB-52-WWZ"/> + <constraint firstItem="nK6-XO-h2t" firstAttribute="top" secondItem="sRb-Ee-0gO" secondAttribute="bottom" id="JPj-zS-Bze"/> <constraint firstItem="nK6-XO-h2t" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="LZN-ga-CaE"/> <constraint firstItem="GMM-3p-jRe" firstAttribute="trailing" secondItem="zub-LG-NJa" secondAttribute="trailing" id="MmD-WW-7cj"/> <constraint firstItem="GMM-3p-jRe" firstAttribute="top" secondItem="zub-LG-NJa" secondAttribute="bottom" constant="20" id="QJn-Ap-lcV"/> - <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="HS8-B5-jBo" secondAttribute="trailing" constant="16" id="RSv-Bk-T1j"/> - <constraint firstItem="CkC-Ms-GkO" firstAttribute="top" secondItem="GMM-3p-jRe" secondAttribute="bottom" constant="50" id="S7D-8h-M4g"/> + <constraint firstItem="CkC-Ms-GkO" firstAttribute="top" secondItem="GMM-3p-jRe" secondAttribute="bottom" constant="20" id="S7D-8h-M4g"/> <constraint firstItem="GMM-3p-jRe" firstAttribute="leading" secondItem="zub-LG-NJa" secondAttribute="leading" id="XEg-qX-IP0"/> <constraint firstItem="CkC-Ms-GkO" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="Yfb-ej-e93"/> + <constraint firstItem="sRb-Ee-0gO" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" id="ZkK-Y2-fnp"/> + <constraint firstItem="tx9-o4-hgS" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="bBV-Q8-eeY"/> <constraint firstItem="zub-LG-NJa" firstAttribute="top" secondItem="nK6-XO-h2t" secondAttribute="bottom" constant="10" id="fQE-Oi-c8X"/> - <constraint firstItem="HS8-B5-jBo" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="lQQ-Kk-H7l"/> - <constraint firstItem="3f0-IX-LtZ" firstAttribute="top" secondItem="CkC-Ms-GkO" secondAttribute="bottom" constant="40" id="spU-lY-vSm"/> + <constraint firstItem="sRb-Ee-0gO" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="qJD-v2-eXk"/> + <constraint firstItem="3f0-IX-LtZ" firstAttribute="top" secondItem="CkC-Ms-GkO" secondAttribute="bottom" constant="20" id="spU-lY-vSm"/> + <constraint firstItem="sRb-Ee-0gO" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="yiC-Qw-Eb9"/> </constraints> <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> <point key="canvasLocation" x="-31.297709923664122" y="27.112676056338028"/> diff --git a/TraccarClient/MainViewController/MainViewController.swift b/TraccarClient/MainViewController/MainViewController.swift index 19b59b463c7349a4d86f25af84d2562c83715447..48f189ff56d23712be002175fa5d44054291de91 100644 --- a/TraccarClient/MainViewController/MainViewController.swift +++ b/TraccarClient/MainViewController/MainViewController.swift @@ -65,12 +65,12 @@ class MainViewController: IASKAppSettingsViewController { } else if frequency <= 0 { self.showError("Invalid frequency value") } else { - StatusViewController.addMessage(NSLocalizedString("Service created", comment: "")) + TransactionsViewController.addMessage(NSLocalizedString("Service created", comment: "")) AppDelegate.instance.trackingController = TrackingController() AppDelegate.instance.trackingController?.start() } } else if !status && AppDelegate.instance.trackingController != nil { - StatusViewController.addMessage(NSLocalizedString("Service destroyed", comment: "")) + TransactionsViewController.addMessage(NSLocalizedString("Service destroyed", comment: "")) AppDelegate.instance.trackingController?.stop() AppDelegate.instance.trackingController = nil } diff --git a/TraccarClient/RequestManager.swift b/TraccarClient/RequestManager.swift index 5085462fe5614a6c19a6446c9d29b9f7c7721630..ff46aa2abbd7a8fd7a708ee782b839a5b263e20c 100644 --- a/TraccarClient/RequestManager.swift +++ b/TraccarClient/RequestManager.swift @@ -25,5 +25,4 @@ public class RequestManager: NSObject { handler(data != nil) }) } - } diff --git a/TraccarClient/SettingsViewController/SettingsViewController.swift b/TraccarClient/SettingsViewController/SettingsViewController.swift new file mode 100644 index 0000000000000000000000000000000000000000..f0127c16e8a65dbb4845e1ec6bfc01793493da6e --- /dev/null +++ b/TraccarClient/SettingsViewController/SettingsViewController.swift @@ -0,0 +1,54 @@ +// +// SettingsViewController.swift +// TraccarClient +// +// Created by George Makhoul on 31/10/2023. +// Copyright © 2023 Traccar. All rights reserved. +// + +import UIKit + +final class SettingsViewController: KNViewController { + // MARK: - Outlets + @IBOutlet weak var customHeaderView: CustomHeaderView! + @IBOutlet weak var tableView: UITableView! + + // MARK: - Properties + + // MARK: - LifeCycle + override func viewDidLoad() { + super.viewDidLoad() + customHeaderView.set(type: .settings, delegate: self) + + } + + private func setupUI() { + tableView.delegate = self + tableView.dataSource = self + tableView.allowsSelection = false + tableView.separatorStyle = .none + } +} +extension SettingsViewController: CustomHeaderViewDelegate { + func rightButtonTapped(action: RightButtonAction) { + print("") + } + + func leftButtonTapped(action: LeftButtonAction) { + self.navigationController?.popViewController(animated: true) + } +} + +// MARK: - UITableViewDelegate +extension SettingsViewController: UITableViewDelegate, UITableViewDataSource { + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + 7 + } + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + <#code#> + } + + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + 40 + } +} diff --git a/TraccarClient/SettingsViewController/SettingsViewController.xib b/TraccarClient/SettingsViewController/SettingsViewController.xib new file mode 100644 index 0000000000000000000000000000000000000000..4150c8fe4ecae52cdf204b705ab821e8c950ad0e --- /dev/null +++ b/TraccarClient/SettingsViewController/SettingsViewController.xib @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="UTF-8"?> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22155" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> + <device id="retina6_12" orientation="portrait" appearance="light"/> + <dependencies> + <deployment identifier="iOS"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/> + <capability name="Safe area layout guides" minToolsVersion="9.0"/> + <capability name="System colors in document resources" minToolsVersion="11.0"/> + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> + </dependencies> + <objects> + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="SettingsViewController" customModule="TraccarClient" customModuleProvider="target"> + <connections> + <outlet property="customHeaderView" destination="2Mw-tn-9Vn" id="d1M-jn-YcM"/> + <outlet property="tableView" destination="WJa-mm-DLt" id="Jc7-4h-NIR"/> + <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> + </connections> + </placeholder> + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> + <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" restorationIdentifier="SettingsViewController" id="i5M-Pr-FkT"> + <rect key="frame" x="0.0" y="0.0" width="393" height="852"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <subviews> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2Mw-tn-9Vn" customClass="CustomHeaderView" customModule="TraccarClient" customModuleProvider="target"> + <rect key="frame" x="0.0" y="0.0" width="393" height="95"/> + <color key="backgroundColor" systemColor="systemBackgroundColor"/> + <constraints> + <constraint firstAttribute="height" constant="95" id="pys-FU-YND"/> + </constraints> + </view> + <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="WJa-mm-DLt"> + <rect key="frame" x="0.0" y="115" width="393" height="737"/> + <color key="backgroundColor" systemColor="systemBackgroundColor"/> + </tableView> + </subviews> + <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/> + <color key="backgroundColor" systemColor="systemBackgroundColor"/> + <constraints> + <constraint firstItem="2Mw-tn-9Vn" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="1Nv-dG-Wrf"/> + <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="WJa-mm-DLt" secondAttribute="trailing" id="Gym-VG-4KE"/> + <constraint firstAttribute="bottom" secondItem="WJa-mm-DLt" secondAttribute="bottom" id="O2b-09-Wye"/> + <constraint firstItem="WJa-mm-DLt" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="QRT-oF-mTT"/> + <constraint firstItem="WJa-mm-DLt" firstAttribute="top" secondItem="2Mw-tn-9Vn" secondAttribute="bottom" constant="20" id="SKa-xP-PbN"/> + <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="2Mw-tn-9Vn" secondAttribute="trailing" id="c61-eX-3EI"/> + <constraint firstItem="2Mw-tn-9Vn" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="jKS-wg-avz"/> + </constraints> + <point key="canvasLocation" x="139.69465648854961" y="19.718309859154932"/> + </view> + </objects> + <resources> + <systemColor name="systemBackgroundColor"> + <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> + </systemColor> + </resources> +</document> diff --git a/TraccarClient/TrackingController.swift b/TraccarClient/TrackingController.swift index 56a832cb96778287855b1338415bcc0348e3cb96..81b76405fb281bea378128cc1ceb243ba105c3c5 100644 --- a/TraccarClient/TrackingController.swift +++ b/TraccarClient/TrackingController.swift @@ -64,7 +64,7 @@ class TrackingController: NSObject, PositionProviderDelegate, NetworkManagerDele } func didUpdate(position: Position) { - StatusViewController.addMessage(NSLocalizedString("Location update", comment: "")) + TransactionsViewController.addMessage(NSLocalizedString("Location update", comment: "")) if buffer { write(position) } else { @@ -73,7 +73,7 @@ class TrackingController: NSObject, PositionProviderDelegate, NetworkManagerDele } func didUpdateNetwork(online: Bool) { - StatusViewController.addMessage(NSLocalizedString("Connectivity change", comment: "")) + TransactionsViewController.addMessage(NSLocalizedString("Connectivity change", comment: "")) if !self.online && online { read() } @@ -124,14 +124,14 @@ class TrackingController: NSObject, PositionProviderDelegate, NetworkManagerDele self.delete(position) } } else { - StatusViewController.addMessage(NSLocalizedString("Send failed", comment: "")) + TransactionsViewController.addMessage(NSLocalizedString("Send failed", comment: "")) if self.buffer { self.retry() } } }) } else { - StatusViewController.addMessage(NSLocalizedString("Send failed", comment: "")) + TransactionsViewController.addMessage(NSLocalizedString("Send failed", comment: "")) if buffer { self.retry() } diff --git a/TraccarClient/TransactionsViewController/Cells/TransactionTableViewCell.swift b/TraccarClient/TransactionsViewController/Cells/TransactionTableViewCell.swift new file mode 100644 index 0000000000000000000000000000000000000000..c865139666ea5fe219458f6675a8968603e6e81f --- /dev/null +++ b/TraccarClient/TransactionsViewController/Cells/TransactionTableViewCell.swift @@ -0,0 +1,43 @@ +// +// TransactionTableViewCell.swift +// TraccarClient +// +// Created by George Makhoul on 31/10/2023. +// Copyright © 2023 Traccar. All rights reserved. +// + +import UIKit + +class TransactionTableViewCell: KNTableViewCell { + // MARK: - Outlets + @IBOutlet weak var descLabel: UILabel! + @IBOutlet weak var statusIcon: UIImageView! + + // MARK: - Properties + + // MARK: - LifeCycle + override func awakeFromNib() { + super.awakeFromNib() + setupUI() + } + + private func setupUI() { + descLabel.set(text: "", color: .main, font: .semibold(16)) + statusIcon.set(icon: UIImage()) + } + + func set(status: String) { + descLabel.set(text: status) + + if status.contains("created") { + statusIcon.set(icon: .thumbsup) + } + if status.contains("update") { + statusIcon.set(icon: .updated) + } + if !status.contains("update") && !status.contains("created") { + statusIcon.set(icon: .thumbsDown) + } + + } +} diff --git a/TraccarClient/TransactionsViewController/Cells/TransactionTableViewCell.xib b/TraccarClient/TransactionsViewController/Cells/TransactionTableViewCell.xib new file mode 100644 index 0000000000000000000000000000000000000000..f4cf250c26a2f89f778b6106c954457003b7835a --- /dev/null +++ b/TraccarClient/TransactionsViewController/Cells/TransactionTableViewCell.xib @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8"?> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22155" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> + <device id="retina6_12" orientation="portrait" appearance="light"/> + <dependencies> + <deployment identifier="iOS"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/> + <capability name="Safe area layout guides" minToolsVersion="9.0"/> + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> + </dependencies> + <objects> + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> + <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="81" id="KGk-i7-Jjw" customClass="TransactionTableViewCell" customModule="TraccarClient" customModuleProvider="target"> + <rect key="frame" x="0.0" y="0.0" width="404" height="81"/> + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> + <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM"> + <rect key="frame" x="0.0" y="0.0" width="404" height="81"/> + <autoresizingMask key="autoresizingMask"/> + <subviews> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wBT-w9-Lgm"> + <rect key="frame" x="16" y="30" width="342" height="21"/> + <fontDescription key="fontDescription" type="system" pointSize="17"/> + <nil key="textColor"/> + <nil key="highlightedColor"/> + </label> + <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="124-DY-ucv"> + <rect key="frame" x="368" y="30.666666666666671" width="20" height="20"/> + <constraints> + <constraint firstAttribute="width" constant="20" id="IrQ-Ur-vNw"/> + <constraint firstAttribute="height" constant="20" id="erc-nI-0WZ"/> + </constraints> + </imageView> + </subviews> + <constraints> + <constraint firstAttribute="trailing" secondItem="124-DY-ucv" secondAttribute="trailing" constant="16" id="JdB-1Q-dWe"/> + <constraint firstItem="124-DY-ucv" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="QCP-hp-pRb"/> + <constraint firstItem="124-DY-ucv" firstAttribute="leading" secondItem="wBT-w9-Lgm" secondAttribute="trailing" constant="10" id="U3l-oR-7Yl"/> + <constraint firstItem="wBT-w9-Lgm" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="YhW-Fp-b4M"/> + <constraint firstItem="wBT-w9-Lgm" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="n2X-Mv-qT0"/> + </constraints> + </tableViewCellContentView> + <viewLayoutGuide key="safeArea" id="njF-e1-oar"/> + <connections> + <outlet property="descLabel" destination="wBT-w9-Lgm" id="AZQ-yO-EmC"/> + <outlet property="statusIcon" destination="124-DY-ucv" id="svP-Dw-sEw"/> + </connections> + <point key="canvasLocation" x="203.0534351145038" y="54.577464788732399"/> + </tableViewCell> + </objects> +</document> diff --git a/TraccarClient/TransactionsViewController/TransactionsViewController.swift b/TraccarClient/TransactionsViewController/TransactionsViewController.swift new file mode 100644 index 0000000000000000000000000000000000000000..8a7afc473866c3dffb0496846fb4cadbbde13a31 --- /dev/null +++ b/TraccarClient/TransactionsViewController/TransactionsViewController.swift @@ -0,0 +1,103 @@ +// +// TransactionsViewController.swift +// TraccarClient +// +// Created by George Makhoul on 31/10/2023. +// Copyright © 2023 Traccar. All rights reserved. +// + +import UIKit + +class TransactionsViewController: KNViewController { + // MARK: - Outlets + @IBOutlet weak var customHeaderView: CustomHeaderView! + @IBOutlet weak var tableView: UITableView! + + // MARK: - Properties + static let LIMIT = 20 + static var transactionViewController: TransactionsViewController? + + static var messages = [String]() + + // MARK: - LifeCycle + override func viewDidLoad() { + super.viewDidLoad() + customHeaderView.set(type: .status, delegate: self) + setupTableView() + } + + private func setupTableView() { + tableView.delegate = self + tableView.dataSource = self + tableView.register(cell: TransactionTableViewCell.self) + tableView.separatorColor = .clear + tableView.allowsSelection = false + tableView.separatorStyle = .none + tableView.reloadData() + } + + // MARK: - Methods + class func addMessage(_ message: String) { + let formatter = DateFormatter() + formatter.dateFormat = "HH:mm - " + + messages.append(formatter.string(from: Date()) + (message)) + + if messages.count > LIMIT { + messages.remove(at: 0) + } + + transactionViewController?.tableView.reloadData() + } + + + + class func clearMessages() { + messages.removeAll() + + transactionViewController?.tableView.reloadData() + } + + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + TransactionsViewController.transactionViewController = self + } + + override func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) + TransactionsViewController.transactionViewController = nil + } +} + +// MARK: - UITableViewDelegate +extension TransactionsViewController: UITableViewDelegate, UITableViewDataSource { + + func numberOfSections(in tableView: UITableView) -> Int { + 1 + } + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + TransactionsViewController.messages.count + } + + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + 40 + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeue(withCell: TransactionTableViewCell.self) + cell.set(status: TransactionsViewController.messages[indexPath.row]) + return cell + } +} + +// MARK: - +extension TransactionsViewController: CustomHeaderViewDelegate { + func rightButtonTapped(action: RightButtonAction) { + TransactionsViewController.clearMessages() + } + + func leftButtonTapped(action: LeftButtonAction) { + self.navigationController?.popViewController(animated: true) + } +} diff --git a/TraccarClient/TransactionsViewController/TransactionsViewController.xib b/TraccarClient/TransactionsViewController/TransactionsViewController.xib new file mode 100644 index 0000000000000000000000000000000000000000..8f5c31f2fdf18aef12e6d2e9d299a2bf7381e3a6 --- /dev/null +++ b/TraccarClient/TransactionsViewController/TransactionsViewController.xib @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="UTF-8"?> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22155" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> + <device id="retina6_12" orientation="portrait" appearance="light"/> + <dependencies> + <deployment identifier="iOS"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/> + <capability name="Safe area layout guides" minToolsVersion="9.0"/> + <capability name="System colors in document resources" minToolsVersion="11.0"/> + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> + </dependencies> + <objects> + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="TransactionsViewController" customModule="TraccarClient" customModuleProvider="target"> + <connections> + <outlet property="customHeaderView" destination="0s1-YY-Zyj" id="omR-dw-Dw1"/> + <outlet property="tableView" destination="tpi-c2-WlY" id="Eim-oG-hC1"/> + <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> + </connections> + </placeholder> + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> + <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT"> + <rect key="frame" x="0.0" y="0.0" width="393" height="852"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <subviews> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0s1-YY-Zyj" customClass="CustomHeaderView" customModule="TraccarClient" customModuleProvider="target"> + <rect key="frame" x="0.0" y="0.0" width="393" height="95"/> + <color key="backgroundColor" systemColor="systemBackgroundColor"/> + <constraints> + <constraint firstAttribute="height" constant="95" id="bvg-rB-2r1"/> + </constraints> + </view> + <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="tpi-c2-WlY"> + <rect key="frame" x="0.0" y="115" width="393" height="737"/> + <color key="backgroundColor" systemColor="systemBackgroundColor"/> + </tableView> + </subviews> + <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/> + <color key="backgroundColor" systemColor="systemBackgroundColor"/> + <constraints> + <constraint firstItem="0s1-YY-Zyj" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="FqS-OM-KRi"/> + <constraint firstItem="0s1-YY-Zyj" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="G2l-9t-DmM"/> + <constraint firstAttribute="bottom" secondItem="tpi-c2-WlY" secondAttribute="bottom" id="M4B-aE-R7O"/> + <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="tpi-c2-WlY" secondAttribute="trailing" id="aiK-mU-vE2"/> + <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="0s1-YY-Zyj" secondAttribute="trailing" id="g3S-mM-c2A"/> + <constraint firstItem="tpi-c2-WlY" firstAttribute="top" secondItem="0s1-YY-Zyj" secondAttribute="bottom" constant="20" id="mTr-7a-slP"/> + <constraint firstItem="tpi-c2-WlY" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="uUN-dD-18M"/> + </constraints> + <point key="canvasLocation" x="139.69465648854961" y="19.718309859154932"/> + </view> + </objects> + <resources> + <systemColor name="systemBackgroundColor"> + <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> + </systemColor> + </resources> +</document> diff --git a/TraccarClient/UIImage.swift b/TraccarClient/UIImage.swift index 46cc3eafae1257c3847773bdab8393d8eda64c97..fa20d8532fcde7a064b53786a07776e77d330954 100644 --- a/TraccarClient/UIImage.swift +++ b/TraccarClient/UIImage.swift @@ -17,6 +17,14 @@ extension UIImage { static let disconnectedLogo = img("disconnectedLogo") static let connectedButton = img("connectedButton") static let disconnectedButton = img("disconnectedButton") + static let menu = img("menu") + static let status = img("status") + static let back = img("back") + static let bin = img("bin") + static let apply = img("apply") + static let thumbsup = img("thumbsup") + static let updated = img("updated") + static let thumbsDown = img("thumbDown") } func img(_ name: String) -> UIImage {