mirror of
https://github.com/AU-COVIDSafe/mobile-ios.git
synced 2025-04-19 13:05:21 +00:00
COVIDSafe code from version 1.1
This commit is contained in:
commit
3640e52eb2
330 changed files with 261540 additions and 0 deletions
41
CovidSafe/UploadDataHomeViewController.swift
Normal file
41
CovidSafe/UploadDataHomeViewController.swift
Normal file
|
@ -0,0 +1,41 @@
|
|||
// Copyright © 2020 Australian Government All rights reserved.
|
||||
|
||||
import UIKit
|
||||
|
||||
final class UploadDataHomeViewController: UIViewController {
|
||||
|
||||
@IBOutlet var messageTextView: UITextView!
|
||||
@IBOutlet weak var consentCheckBox: UIButton!
|
||||
@IBOutlet weak var agreeButton: UIButton!
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
consentCheckBox.setImage(UIImage(named: "emptyCheckbox"), for: .normal)
|
||||
consentCheckBox.setImage(UIImage(named: "selectedCheckbox"), for: .selected)
|
||||
setupMessageTextView()
|
||||
updateContinueButton()
|
||||
}
|
||||
|
||||
private func setupMessageTextView() {
|
||||
messageTextView.textContainer.lineFragmentPadding = 0.0
|
||||
messageTextView.addLink("https://www.health.gov.au/using-our-websites/privacy/privacy-notice-for-covidsafe-app", enclosedIn: "*")
|
||||
}
|
||||
|
||||
@IBAction func onCheckboxTapped(sender: UIButton) {
|
||||
sender.isSelected = !sender.isSelected
|
||||
self.agreeButton.isEnabled = sender.isSelected
|
||||
updateContinueButton()
|
||||
}
|
||||
|
||||
@IBAction func onBackTapped(_ sender: UIButton) {
|
||||
navigationController?.popViewController(animated: true)
|
||||
}
|
||||
|
||||
func updateContinueButton() {
|
||||
if (agreeButton.isEnabled) {
|
||||
agreeButton.backgroundColor = UIColor.covidSafeButtonColor
|
||||
} else {
|
||||
agreeButton.backgroundColor = UIColor(0xDBDDDD)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue