Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/remote config #27

Merged
merged 5 commits into from May 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions Covid.xcodeproj/project.pbxproj
Expand Up @@ -15,6 +15,7 @@
0F1181492416C70900213533 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0F1181472416C70900213533 /* LaunchScreen.storyboard */; };
0F247F06241A61AC00986740 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0F247F05241A61AC00986740 /* Assets.xcassets */; };
0F247F08241A63F000986740 /* WelcomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0F247F07241A63F000986740 /* WelcomeViewController.swift */; };
0F4A292C2457BB48003274B0 /* DateExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0F4A292B2457BB48003274B0 /* DateExtensions.swift */; };
0F629282241D4F5A00FF5E14 /* LocationTracker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0F62927F241D4F4700FF5E14 /* LocationTracker.swift */; };
0F629284241D4F5A00FF5E14 /* LocationManagerHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0F629281241D4F5A00FF5E14 /* LocationManagerHandler.swift */; };
0F629286241D4F6F00FF5E14 /* BeaconManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0F629285241D4F6F00FF5E14 /* BeaconManager.swift */; };
Expand Down Expand Up @@ -137,6 +138,7 @@
0F11814A2416C70900213533 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
0F247F05241A61AC00986740 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
0F247F07241A63F000986740 /* WelcomeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomeViewController.swift; sourceTree = "<group>"; };
0F4A292B2457BB48003274B0 /* DateExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateExtensions.swift; sourceTree = "<group>"; };
0F62927F241D4F4700FF5E14 /* LocationTracker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LocationTracker.swift; sourceTree = "<group>"; };
0F629281241D4F5A00FF5E14 /* LocationManagerHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LocationManagerHandler.swift; sourceTree = "<group>"; };
0F629285241D4F6F00FF5E14 /* BeaconManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BeaconManager.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -464,6 +466,7 @@
21B0F85A2438D0AA00552491 /* NotificationCenterObserver.swift */,
21662E58244D87B0002883E8 /* UINavigationBar+Transparent.swift */,
21B0F8932439194100552491 /* UIStoryBoard.swift */,
0F4A292B2457BB48003274B0 /* DateExtensions.swift */,
);
path = Extensions;
sourceTree = "<group>";
Expand Down Expand Up @@ -849,6 +852,7 @@
C009157C241EF7610012F557 /* AddressConfirmationViewController.swift in Sources */,
0FF4F21E241AEFBC00643297 /* CovidService.swift in Sources */,
21B0F85B2438D0AA00552491 /* NotificationCenterObserver.swift in Sources */,
0F4A292C2457BB48003274B0 /* DateExtensions.swift in Sources */,
0FB533D5243F82F500A70E62 /* NCZIService.swift in Sources */,
0FF4F224241AF61600643297 /* APIRequests.swift in Sources */,
21B0F8922438D37D00552491 /* FaceIDNotification.swift in Sources */,
Expand Down Expand Up @@ -1035,7 +1039,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
CURRENT_PROJECT_VERSION = 137;
CURRENT_PROJECT_VERSION = 192;
ENABLE_BITCODE = YES;
INFOPLIST_FILE = Covid/Resources/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
Expand All @@ -1062,7 +1066,7 @@
CODE_SIGN_ENTITLEMENTS = Covid/Covid.entitlements;
CODE_SIGN_IDENTITY = "Apple Distribution: Narodne centrum zdravotnickych informacii (SJNG272QAP)";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 137;
CURRENT_PROJECT_VERSION = 192;
DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = YES;
INFOPLIST_FILE = Covid/Resources/Info.plist;
Expand Down
13 changes: 10 additions & 3 deletions Covid/AdditionalInfo/IdentityViewController.swift
Expand Up @@ -34,7 +34,7 @@ import SwiftyUserDefaults

final class IdentityViewController: ViewController {
@IBOutlet private var idLabel: UILabel!
@IBOutlet private var aboutAppView: UIView!
@IBOutlet private var uploadDataView: UIView!
@IBOutlet private var cooperationLabel: UILabel!

override func viewWillAppear(_ animated: Bool) {
Expand All @@ -46,6 +46,9 @@ final class IdentityViewController: ViewController {
idLabel.text = hashids.encode(profileId)?.uppercased()
}

// automatic upload disabled
uploadDataView.isHidden = false // Firebase.remoteBoolValue(for: .reporting)

navigationController?.navigationBar.isHidden = true
}

Expand All @@ -57,8 +60,8 @@ final class IdentityViewController: ViewController {

override func loadView() {
super.loadView()
aboutAppView.layer.cornerRadius = 20
aboutAppView.layer.masksToBounds = true
uploadDataView.layer.cornerRadius = 20
uploadDataView.layer.masksToBounds = true

idLabel.isCopyingEnabled = true

Expand All @@ -71,4 +74,8 @@ final class IdentityViewController: ViewController {
attributedString.setAttributes([.font: UIFont(name: "Poppins-Bold", size: 15.0)!], range: sygicRange)
cooperationLabel.attributedText = attributedString
}

@IBAction private func uploadDataTapped(_ sender: UIButton) {
LocationReporter.shared.sendConnections(forceUpload: true)
}
}
2 changes: 1 addition & 1 deletion Covid/AdditionalInfo/PreventionViewController.swift
Expand Up @@ -25,7 +25,7 @@ import UIKit

final class PreventionViewController: ViewController {

@IBOutlet weak var tableView: UITableView!
@IBOutlet private weak var tableView: UITableView!

let datasource = [
("prevention01", "Často si umývajte ruky mydlom a vodou, najmenej po dobu 20 sekúnd. Môžete použiť dezinfekčný prostriedok na ruky na báze alkoholu."),
Expand Down
32 changes: 8 additions & 24 deletions Covid/AdditionalInfo/SymptomsViewController.swift
Expand Up @@ -27,8 +27,8 @@ final class SymptomsViewController: ViewController {

@IBOutlet private weak var bodyLabel: UILabel!

override func viewDidLoad() {
super.viewDidLoad()
override func loadView() {
super.loadView()

updateUI()
}
Expand All @@ -37,27 +37,11 @@ final class SymptomsViewController: ViewController {
extension SymptomsViewController {

private func updateUI() {
let bullet = "• "
var strings = [String]()
strings.append("suchým, zadúšavým, dráždivým kašľom bez hlienov")
strings.append("bolestami hlavy, kĺbov a svalov")
strings.append("celkovou vyčerpanosťou")
strings.append("pocitom ťažoby a pichaním na hrudníku alebo pocitom tzv. “nedostatočného nádychu”.")
strings.append("""
vysoká teplota na hranici, alebo tesne za hranicou 38 stupňov, ale rovnako aj vysoko za hranicou 38 stupňov, \
v kombinácii s kašľom a zvyškom uvedených príznakov sú taktiež príznakom ochorenia.
""")
strings = strings.map { bullet + $0 }

var attributes = [NSAttributedString.Key: Any]()
attributes[.font] = UIFont(name: "Poppins-Regular", size: 15)
attributes[.foregroundColor] = UIColor(red: 57 / 255, green: 57 / 255, blue: 57 / 255, alpha: 1)

let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.headIndent = (bullet as NSString).size(withAttributes: attributes).width
attributes[.paragraphStyle] = paragraphStyle

let string = strings.joined(separator: "\n\n")
bodyLabel.attributedText = NSAttributedString(string: string, attributes: attributes)
let text = "Ľudia nakazení COVID-19 udávajú široké spektrum prejavov, od miernych až po závažné.\n\nPrejavy sa zvyčajne objavujú 2-14 dní po vystavení sa nákaze a môžu zahŕňať:"
let attributes: [NSAttributedString.Key: Any] = [.font: UIFont(name: "Poppins-Light", size: 17.0)!, .foregroundColor: UIColor.darkGray]
let attributedString = NSMutableAttributedString(string: text, attributes: attributes)
let boldRange = (attributedString.string as NSString).range(of: "2-14 dní po vystavení sa nákaze")
attributedString.setAttributes([.font: UIFont(name: "Poppins-Bold", size: 17.0)!], range: boldRange)
bodyLabel.attributedText = attributedString
}
}