1- // SPDX-FileCopyrightText: Nextcloud GmbH
2- // SPDX-FileCopyrightText: 2017 Marino Faggiana
3- // SPDX-License-Identifier: GPL-3.0-or-later
1+ //
2+ // NCBrandColor.swift
3+ // Nextcloud
4+ //
5+ // Created by Marino Faggiana on 24/04/17.
6+ // Copyright (c) 2017 Marino Faggiana. All rights reserved.
7+ //
8+ // Author Marino Faggiana <marino.faggiana@nextcloud.com>
9+ //
10+ // This program is free software: you can redistribute it and/or modify
11+ // it under the terms of the GNU General Public License as published by
12+ // the Free Software Foundation, either version 3 of the License, or
13+ // (at your option) any later version.
14+ //
15+ // This program is distributed in the hope that it will be useful,
16+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
17+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+ // GNU General Public License for more details.
19+ //
20+ // You should have received a copy of the GNU General Public License
21+ // along with this program. If not, see <http://www.gnu.org/licenses/>.
22+ //
423
524import UIKit
6- import NextcloudKit
725
826let userAgent : String = {
927 let appVersion : String = Bundle . main. object ( forInfoDictionaryKey: " CFBundleShortVersionString " ) as! String
@@ -21,6 +39,7 @@ let userAgent: String = {
2139
2240//final class NCBrandOptions: @unchecked Sendable {
2341// static let shared = NCBrandOptions()
42+
2443@objc class NCBrandOptions : NSObject , @unchecked Sendable {
2544 @objc static let shared : NCBrandOptions = {
2645 let instance = NCBrandOptions ( )
@@ -31,6 +50,7 @@ let userAgent: String = {
3150 @objc public var textCopyrightNextcloudiOS : String = " MagentaCLOUD for iOS %@ "
3251 @objc public var textCopyrightNextcloudServer : String = " MagentaCLOUD Server %@ "
3352 @objc public var loginBaseUrl : String = " https://magentacloud.de "
53+
3454 @objc public var pushNotificationServerProxy : String = " https://push-notifications.nextcloud.com "
3555 @objc public var linkLoginHost : String = " https://nextcloud.com/install "
3656 @objc public var linkloginPreferredProviders : String = " https://nextcloud.com/signup-ios "
@@ -47,19 +67,26 @@ let userAgent: String = {
4767 // Auto Upload default folder
4868 @objc public var folderDefaultAutoUpload : String = Locale . current. languageCode == " de " ? " Kamera-Medien " : " Camera-Media "
4969
50- // Capabilities Group
51- @objc public var capabilitiesGroup : String = " group.de.telekom.Mediencenter "
52- @objc public var capabilitiesGroupApps : String = " group.de.telekom.Mediencenter "
70+ // Options
5371
72+ //#if DEBUG
73+ // QA :
74+ @objc public var capabilitiesGroup : String = " group.com.t-systems.pu-ds.magentacloud.qa "
75+ @objc public var capabilitiesGroupApps : String = " group.com.t-systems.pu-ds.magentacloud.qa "
76+ //#else
77+ // // PROD :
78+ // @objc public var capabilitiesGroup: String = "group.de.telekom.Mediencenter"
79+ // @objc public var capabilitiesGroupApps: String = "group.de.telekom.Mediencenter"
80+ //#endif
81+
5482 // BRAND ONLY
5583 // Set use_login_web_personalized to true for prod and false for configurable path
5684 @objc public var use_login_web_personalized : Bool = true // Don't touch me !!
5785 @objc public var use_AppConfig : Bool = false // Don't touch me !!
5886 @objc public var use_GroupApps : Bool = true // Don't touch me !!
5987
60- // Options
61- // Use server theming color
6288 @objc public var use_default_auto_upload : Bool = false
89+ // Use server theming color
6390 @objc public var use_themingColor : Bool = false
6491 @objc public var use_themingLogo : Bool = false
6592 @objc public var use_storeLocalAutoUploadAll : Bool = false
@@ -81,16 +108,16 @@ let userAgent: String = {
81108 @objc var use_in_app_browser_for_login = false
82109 var enforce_privacyScreenEnabled = false
83110
84- // Example: (name: "Name 1", url: "https://cloud.nextcloud.com"),(name: "Name 2", url: "https://cloud.nextcloud.com")
111+ // (name: "Name 1", url: "https://cloud.nextcloud.com"),(name: "Name 2", url: "https://cloud.nextcloud.com")
85112 var enforce_servers : [ ( name: String , url: String ) ] = [ ]
86113
87114 // Internal option behaviour
88115 @objc var cleanUpDay : Int = 0 // Set default "Delete all cached files older than" possible days value are: 0, 1, 7, 30, 90, 180, 365
89116
90117 // Max request/download/upload concurrent
91- let httpMaximumConnectionsPerHost : Int = 8
92- let httpMaximumConnectionsPerHostInDownload : Int = 8
93- let httpMaximumConnectionsPerHostInUpload : Int = 8
118+ let httpMaximumConnectionsPerHost : Int = 6
119+ let httpMaximumConnectionsPerHostInDownload : Int = 6
120+ let httpMaximumConnectionsPerHostInUpload : Int = 6
94121
95122 // Max request/download/upload process
96123 let numMaximumProcess : Int = 50
@@ -104,7 +131,7 @@ let userAgent: String = {
104131 case activity, sharing
105132 }
106133
107- init ( ) {
134+ override init ( ) {
108135 // wrapper AppConfig
109136 if let configurationManaged = UserDefaults . standard. dictionary ( forKey: " com.apple.configuration.managed " ) , use_AppConfig {
110137 if let str = configurationManaged [ NCGlobal . shared. configuration_brand] as? String {
@@ -150,13 +177,12 @@ let userAgent: String = {
150177}
151178
152179class NCBrandColor : NSObject , @unchecked Sendable {
153- static let shared : NCBrandColor = {
180+ @ objc static let shared : NCBrandColor = {
154181 let instance = NCBrandColor ( )
155182 return instance
156183 } ( )
157184
158- /// This is rewrited from customet theme, default is Nextcloud color
159- ///
185+ // Color
160186 @objc let customer : UIColor = UIColor ( red: 226.0 / 255.0 , green: 0.0 / 255.0 , blue: 116.0 / 255.0 , alpha: 1.0 )
161187 @objc var customerText : UIColor = . white
162188
@@ -420,4 +446,20 @@ class NCBrandColor: NSObject, @unchecked Sendable {
420446 @objc public var seperatorRename : UIColor = UIColor ( red: 235.0 / 255.0 , green: 235.0 / 255.0 , blue: 235.0 / 255.0 , alpha: 1.0 )
421447 @objc public let gray : UIColor = UIColor ( red: 104.0 / 255.0 , green: 104.0 / 255.0 , blue: 104.0 / 255.0 , alpha: 1.0 )
422448 @objc public var nmcIconSharedWithMe : UIColor = UIColor ( displayP3Red: 0.0 / 255.0 , green: 153.0 / 255.0 , blue: 255.0 / 255.0 , alpha: 1.0 )
449+
450+ var shareBlueColor : UIColor {
451+ if UITraitCollection . current. userInterfaceStyle == . dark {
452+ return UIColor ( hex: " #7d94f9 " ) !
453+ } else {
454+ return UIColor ( hex: " #2238df " ) !
455+ }
456+ }
457+
458+ var shareBlackColor : UIColor {
459+ if UITraitCollection . current. userInterfaceStyle == . dark {
460+ return UIColor . white
461+ } else {
462+ return UIColor . black
463+ }
464+ }
423465}
0 commit comments