SafeDeactivatedViewController.swift 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // _____ _
  2. // |_ _| |_ _ _ ___ ___ _ __ __ _
  3. // | | | ' \| '_/ -_) -_) ' \/ _` |_
  4. // |_| |_||_|_| \___\___|_|_|_\__,_(_)
  5. //
  6. // Threema iOS Client
  7. // Copyright (c) 2018-2020 Threema GmbH
  8. //
  9. // This program is free software: you can redistribute it and/or modify
  10. // it under the terms of the GNU Affero General Public License, version 3,
  11. // as published by the Free Software Foundation.
  12. //
  13. // This program is distributed in the hope that it will be useful,
  14. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. // GNU Affero General Public License for more details.
  17. //
  18. // You should have received a copy of the GNU Affero General Public License
  19. // along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. import UIKit
  21. class SafeDeactivatedViewController: ThemedViewController {
  22. @IBOutlet weak var introImage: UIImageView!
  23. @IBOutlet weak var descriptionLabel: UILabel!
  24. @IBOutlet weak var introCircle: UIView!
  25. @IBOutlet weak var explainButton: UIButton!
  26. override func viewDidLoad() {
  27. super.viewDidLoad()
  28. self.descriptionLabel.text = NSLocalizedString("safe_enable_explain_short", comment: "")
  29. self.introCircle.layer.cornerRadius = self.introCircle.frame.height / 2
  30. setupColors()
  31. }
  32. @objc override func refresh() {
  33. setupColors()
  34. }
  35. private func setupColors() {
  36. Colors.setTextColor(Colors.fontNormal(), in: self.view)
  37. self.view.backgroundColor = Colors.background()
  38. self.introCircle.backgroundColor = UIColor(red: 235.0/255.0, green: 235.0/255.0, blue: 235.0/255.0, alpha: 1.0)
  39. let explainImage = self.explainButton.imageView?.image!.withTint(Colors.main())
  40. self.explainButton.setImage(explainImage, for: .normal)
  41. }
  42. }
  43. extension SafeDeactivatedViewController {
  44. @IBAction func touchDownExplainButton(_ sender: UIButton, forEvent event: UIEvent) {
  45. UIAlertTemplate.showAlert(owner: self, title: "Threema Safe", message: NSLocalizedString("safe_enable_explain", comment: ""))
  46. }
  47. }