NCBrand.swift 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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. //
  23. import UIKit
  24. class NCBrandColor: NSObject {
  25. @objc static let sharedInstance: NCBrandColor = {
  26. let instance = NCBrandColor()
  27. instance.setDarkMode()
  28. return instance
  29. }()
  30. // Color
  31. @objc public let customer: UIColor = UIColor(red: 0.0/255.0, green: 130.0/255.0, blue: 201.0/255.0, alpha: 1.0) // BLU NC : #0082c9
  32. @objc public var customerText: UIColor = .white
  33. @objc public var brand: UIColor // don't touch me
  34. @objc public var brandElement: UIColor // don't touch me
  35. @objc public var brandText: UIColor // don't touch me
  36. @objc public var connectionNo: UIColor = UIColor(red: 204.0/255.0, green: 204.0/255.0, blue: 204.0/255.0, alpha: 1.0)
  37. @objc public var encrypted: UIColor = .red
  38. @objc public var backgroundView: UIColor = .white
  39. @objc public var backgroundForm: UIColor = UIColor(red: 244.0/255.0, green: 244.0/255.0, blue: 244.0/255.0, alpha: 1.0)
  40. @objc public var textView: UIColor = .black
  41. @objc public var separator: UIColor = UIColor(red: 235.0/255.0, green: 235.0/255.0, blue: 235.0/255.0, alpha: 1.0)
  42. @objc public var tabBar: UIColor = .white
  43. @objc public let nextcloud: UIColor = UIColor(red: 0.0/255.0, green: 130.0/255.0, blue: 201.0/255.0, alpha: 1.0)
  44. @objc public let nextcloudSoft: UIColor = UIColor(red: 90.0/255.0, green: 160.0/255.0, blue: 210.0/255.0, alpha: 1.0)
  45. @objc public let icon: UIColor = UIColor(red: 104.0/255.0, green: 104.0/255.0, blue: 104.0/255.0, alpha: 1.0)
  46. @objc public let optionItem: UIColor = UIColor(red: 178.0/255.0, green: 178.0/255.0, blue: 178.0/255.0, alpha: 1.0)
  47. @objc public let graySoft: UIColor = UIColor(red: 162.0/255.0, green: 162.0/255.0, blue: 162.0/255.0, alpha: 0.5)
  48. @objc public let yellowFavorite: UIColor = UIColor(red: 248.0/255.0, green: 205.0/255.0, blue: 70.0/255.0, alpha: 1.0)
  49. @objc public let textInfo: UIColor = UIColor(red: 153.0/255.0, green: 153.0/255.0, blue: 153.0/255.0, alpha: 1.0)
  50. @objc public var select: UIColor = .white
  51. override init() {
  52. self.brand = self.customer
  53. self.brandElement = self.customer
  54. self.brandText = self.customerText
  55. }
  56. @objc public func setDarkMode() {
  57. let darkMode = CCUtility.getDarkMode()
  58. if darkMode {
  59. tabBar = .black
  60. backgroundView = .black
  61. backgroundForm = UIColor(red: 50.0/255.0, green: 50.0/255.0, blue: 50.0/255.0, alpha: 1.0)
  62. textView = .white
  63. separator = UIColor(red: 60.0/255.0, green: 60.0/255.0, blue: 60.0/255.0, alpha: 1.0)
  64. select = UIColor.white.withAlphaComponent(0.2)
  65. } else {
  66. tabBar = .white
  67. backgroundView = .white
  68. backgroundForm = UIColor(red: 244.0/255.0, green: 244.0/255.0, blue: 244.0/255.0, alpha: 1.0)
  69. textView = .black
  70. separator = UIColor(red: 235.0/255.0, green: 235.0/255.0, blue: 235.0/255.0, alpha: 1.0)
  71. select = self.brand.withAlphaComponent(0.1)
  72. }
  73. }
  74. }
  75. @objc class NCBrandOptions: NSObject {
  76. @objc static let sharedInstance: NCBrandOptions = {
  77. let instance = NCBrandOptions()
  78. return instance
  79. }()
  80. @objc public let brand: String = "Nextcloud"
  81. @objc public let mailMe: String = "ios@nextcloud.com"
  82. @objc public let textCopyrightNextcloudiOS: String = "Nextcloud for iOS %@ © 2019"
  83. @objc public let textCopyrightNextcloudServer: String = "Nextcloud Server %@"
  84. @objc public let loginBaseUrl: String = "https://cloud.nextcloud.com"
  85. @objc public let pushNotificationServerProxy: String = "https://push-notifications.nextcloud.com"
  86. @objc public let linkLoginHost: String = "https://nextcloud.com/install"
  87. @objc public let linkloginPreferredProviders: String = "https://nextcloud.com/signup";
  88. @objc public let middlewarePingUrl: String = ""
  89. @objc public let webLoginAutenticationProtocol: String = "nc://" // example "abc://"
  90. // Personalized
  91. @objc public let webCloseViewProtocolPersonalized: String = "" // example "abc://change/plan" Don't touch me !!
  92. @objc public let folderBrandAutoUpload: String = "" // example "_auto_upload_folder_" Don't touch me !!
  93. // Auto Upload default folder
  94. @objc public var folderDefaultAutoUpload: String = "Photos"
  95. // Capabilities Group
  96. @objc public let capabilitiesGroups: String = "group.it.twsweb.Crypto-Cloud"
  97. // User Agent
  98. @objc public var userAgent: String = "Nextcloud-iOS" // Don't touch me !!
  99. // Options
  100. @objc public let use_login_web_personalized: Bool = false // Don't touch me !!
  101. @objc public let use_default_auto_upload: Bool = false
  102. @objc public let use_themingColor: Bool = true
  103. @objc public let use_themingBackground: Bool = true
  104. @objc public let use_themingLogo: Bool = false
  105. @objc public let use_middlewarePing: Bool = false
  106. @objc public let use_storeLocalAutoUploadAll: Bool = false
  107. @objc public let use_imi_viewer: Bool = false // Don't touch me !!
  108. @objc public let use_configuration: Bool = false // Don't touch me !!
  109. @objc public let disable_intro: Bool = false
  110. @objc public let disable_request_login_url: Bool = false
  111. @objc public let disable_multiaccount: Bool = false
  112. @objc public let disable_manage_account: Bool = false
  113. @objc public let disable_more_external_site: Bool = false
  114. @objc public let disable_openin_file: Bool = false // Don't touch me !!
  115. override init() {
  116. if folderBrandAutoUpload != "" {
  117. folderDefaultAutoUpload = folderBrandAutoUpload
  118. }
  119. }
  120. }
  121. @objc class NCBrandConfiguration: NSObject {
  122. @objc static let sharedInstance: NCBrandConfiguration = {
  123. let instance = NCBrandConfiguration()
  124. return instance
  125. }()
  126. @objc public let configuration_key: String = "it.twsweb.Nextcloud"
  127. @objc public let configuration_serverUrl: String = "serverUrl"
  128. @objc public let configuration_username: String = "username"
  129. @objc public let configuration_password: String = "password"
  130. }