From 5a00a1b66e9dc03b943dbfabef2d4d2b4889a541 Mon Sep 17 00:00:00 2001 From: Kateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com> Date: Wed, 20 Sep 2023 15:37:05 -0400 Subject: [PATCH] misc: cleanup Change-Id: Ia9f7ed6fc957e70255aeffb38683508560bec442 --- .../CreateAccountViewController.swift | 2 +- .../Walkthrough/WalkthroughCoordinator.swift | 1 - .../Walkthrough/WelcomeViewController.swift | 27 +------------------ 3 files changed, 2 insertions(+), 28 deletions(-) diff --git a/Ring/Ring/Features/Walkthrough/CreateAccount/CreateAccountViewController.swift b/Ring/Ring/Features/Walkthrough/CreateAccount/CreateAccountViewController.swift index 889c74887..c7a8876dc 100644 --- a/Ring/Ring/Features/Walkthrough/CreateAccount/CreateAccountViewController.swift +++ b/Ring/Ring/Features/Walkthrough/CreateAccount/CreateAccountViewController.swift @@ -117,7 +117,7 @@ class CreateAccountViewController: UIViewController, StoryboardBased, ViewModelB } func adaptToSystemColor() { - view.backgroundColor = UIColor.jamiBackgroundColor + view.backgroundColor = .clear } func setContentInset(keyboardHeight: CGFloat = 0) { diff --git a/Ring/Ring/Features/Walkthrough/WalkthroughCoordinator.swift b/Ring/Ring/Features/Walkthrough/WalkthroughCoordinator.swift index 36245107b..90745974e 100644 --- a/Ring/Ring/Features/Walkthrough/WalkthroughCoordinator.swift +++ b/Ring/Ring/Features/Walkthrough/WalkthroughCoordinator.swift @@ -98,7 +98,6 @@ class WalkthroughCoordinator: Coordinator, StateableResponsive { switch walkthroughType { case .createAccount: let createAccountViewController = CreateAccountViewController.instantiate(with: self.injectionBag) - createAccountViewController.view.backgroundColor = .clear self.present(viewController: createAccountViewController, withStyle: .formModal, withAnimation: true, withStateable: createAccountViewController.viewModel) case .createSipAccount: let sipAccountViewController = CreateSipAccountViewController.instantiate(with: self.injectionBag) diff --git a/Ring/Ring/Features/Walkthrough/WelcomeViewController.swift b/Ring/Ring/Features/Walkthrough/WelcomeViewController.swift index 6bb8f0c41..24c5a61aa 100644 --- a/Ring/Ring/Features/Walkthrough/WelcomeViewController.swift +++ b/Ring/Ring/Features/Walkthrough/WelcomeViewController.swift @@ -130,32 +130,7 @@ class WelcomeViewController: UIViewController, StoryboardBased, ViewModelBased { } private func aboutJamiButtonDidTap() { - var compileDate: String { - let dateDefault = "" - let dateFormatter = DateFormatter() - dateFormatter.dateFormat = "YYYYMMdd" - let bundleName = Bundle.main.infoDictionary!["CFBundleName"] as? String ?? "Info.plist" - if let infoPath = Bundle.main.path(forResource: bundleName, ofType: nil), - let infoAttr = try? FileManager.default.attributesOfItem(atPath: infoPath), - let infoDate = infoAttr[FileAttributeKey.creationDate] as? Date { - return dateFormatter.string(from: infoDate) - } - return dateDefault - } - - let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "" - - let versionName = "Világfa" - let alert = UIAlertController(title: "\nJami\nversion: \(appVersion)(\(compileDate))\n\(versionName)", message: "", preferredStyle: .alert) - alert.addAction(UIAlertAction(title: L10n.Global.ok, style: .default, handler: nil)) - let image = UIImageView(image: UIImage(asset: Asset.jamiIcon)) - alert.view.addSubview(image) - image.translatesAutoresizingMaskIntoConstraints = false - alert.view.addConstraint(NSLayoutConstraint(item: image, attribute: .centerX, relatedBy: .equal, toItem: alert.view, attribute: .centerX, multiplier: 1, constant: 0)) - alert.view.addConstraint(NSLayoutConstraint(item: image, attribute: .centerY, relatedBy: .equal, toItem: alert.view, attribute: .top, multiplier: 1, constant: 0.0)) - alert.view.addConstraint(NSLayoutConstraint(item: image, attribute: .width, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1.0, constant: 64.0)) - alert.view.addConstraint(NSLayoutConstraint(item: image, attribute: .height, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1.0, constant: 64.0)) - self.present(alert, animated: true, completion: nil) + AppInfoHelper.showAboutJamiAlert(onViewController: self) } func setupButtonActions() { -- GitLab