From dc30ee83718a42a0006bdbacf19388ac20358f9b Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Tue, 17 Oct 2023 17:16:37 +0530 Subject: [PATCH] NMC 1615 - Login screen status bar color update and title removed --- .../File Provider Extension UI.xcscheme | 1 - .../WidgetDashboardIntentHandler.xcscheme | 1 - iOSClient/Login/NCLoginProvider.swift | 20 +++++++++++++------ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme index c06627e268..e19e0492e1 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme @@ -73,7 +73,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" - askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme index e7fe4caf7c..0b68bbe8b4 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme @@ -73,7 +73,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" - askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/iOSClient/Login/NCLoginProvider.swift b/iOSClient/Login/NCLoginProvider.swift index d43cc5dc04..8453cbce60 100644 --- a/iOSClient/Login/NCLoginProvider.swift +++ b/iOSClient/Login/NCLoginProvider.swift @@ -56,14 +56,22 @@ class NCLoginProvider: UIViewController { NCContentPresenter().showError(error: error, priority: .max) } - if let host = URL(string: urlBase)?.host { - titleView = host - if let account = NCManageDatabase.shared.getActiveAccount(), NCKeychain().getPassword(account: account.account).isEmpty { - titleView = NSLocalizedString("_user_", comment: "") + " " + account.userId + " " + NSLocalizedString("_in_", comment: "") + " " + host + if #available(iOS 13, *) { + let keyWindow = UIApplication.shared.connectedScenes + .filter({$0.activationState == .foregroundActive}) + .map({$0 as? UIWindowScene}) + .compactMap({$0}) + .first?.windows + .filter({$0.isKeyWindow}).first + let statusBar = UIView(frame: (keyWindow?.windowScene?.statusBarManager?.statusBarFrame)!) + statusBar.backgroundColor = NCBrandColor.shared.customer + keyWindow?.addSubview(statusBar) + } else { + if let statusBar = UIApplication.shared.value(forKey: "statusBar") as? UIView { + statusBar.backgroundColor = NCBrandColor.shared.customer } } - - self.title = titleView + self.navigationController?.navigationBar.backgroundColor = NCBrandColor.shared.customer } override func viewDidAppear(_ animated: Bool) {