COVIDSafe code from version 1.9 (#18)

This commit is contained in:
COVIDSafe Support 2020-08-03 16:01:39 +10:00 committed by GitHub
parent 2257c542ed
commit 3b1d8fa3f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
41 changed files with 4217 additions and 3998 deletions

View file

@ -254,13 +254,13 @@ class HomeViewController: UIViewController {
toggleViewVisibility(view: homeHeaderPermissionsOffImage, isVisible: !self.allPermissionOn)
toggleViewVisibility(view: lottieBluetoothView, isVisible: self.allPermissionOn)
var newAttributedLabel = NSMutableAttributedString(string: "home_header_active_title".localizedString(comment: "Header with no action req"), attributes: [.font: UIFont.preferredFont(forTextStyle: .title1).bold()])
var newAttributedLabel = NSMutableAttributedString(string: "home_header_active_title".localizedString(comment: "Header with no action req"), attributes: [.font: UIFont.preferredFont(for: .title1, weight: .bold)])
newAttributedLabel.append(NSAttributedString(string: "\n" + "home_header_active_no_action_required".localizedString(), attributes: [.font: UIFont.preferredFont(forTextStyle: .body)]))
self.homeHeaderInfoText.attributedText = newAttributedLabel
if (!self.allPermissionOn) {
newAttributedLabel = NSMutableAttributedString(string: "home_header_inactive_title".localizedString(comment: "Header with no action req"), attributes: [.font: UIFont.preferredFont(forTextStyle: .title1).bold()])
newAttributedLabel = NSMutableAttributedString(string: "home_header_inactive_title".localizedString(comment: "Header with no action req"), attributes: [.font: UIFont.preferredFont(for: .title1, weight: .bold)])
newAttributedLabel.append(NSAttributedString(string: "\n" + "home_header_inactive_check_your_permissions".localizedString(), attributes: [.font: UIFont.preferredFont(forTextStyle: .body)]))
animatedBluetoothHeaderHeightConstraint.constant = animatedHeaderInactiveHeightConstant
@ -342,6 +342,22 @@ class HomeViewController: UIViewController {
UIApplication.shared.open(settingsURL)
}
@IBAction func onChangeLanguageTapped(_ sender: UITapGestureRecognizer) {
if #available(iOS 13.0, *) {
guard let settingsURL = URL(string: UIApplication.openSettingsURLString) else {
return
}
UIApplication.shared.open(settingsURL)
} else {
let nav = HelpNavController()
nav.pageSectionId = "other-languages"
nav.modalTransitionStyle = .coverVertical
nav.modalPresentationStyle = .fullScreen
present(nav, animated: true, completion: nil)
}
}
@IBAction func onBluetoothPhoneSettingsTapped(_ sender: Any) {
attemptTurnOnBluetooth()
}