Parcourir la source

new setting colors

Marino Faggiana il y a 8 ans
Parent
commit
4b186663bc

+ 0 - 10
Nextcloud.xcodeproj/project.pbxproj

@@ -109,10 +109,6 @@
 		F71E68021DC1F79D003BA52B /* libownCloudiOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F71E67FC1DC1F76F003BA52B /* libownCloudiOS.a */; };
 		F720E01F1E48C73E001A4B9E /* CCActions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F720E01E1E48C73E001A4B9E /* CCActions.swift */; };
 		F725437C1E12A44A009BF4C2 /* CCSection.m in Sources */ = {isa = PBXBuildFile; fileRef = F78F6FAF1CC8CCB700F4EA25 /* CCSection.m */; };
-		F7274FED1E6EB6F400C241B6 /* Constant.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7274FEC1E6EB6F400C241B6 /* Constant.swift */; };
-		F7274FEE1E6EB6F400C241B6 /* Constant.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7274FEC1E6EB6F400C241B6 /* Constant.swift */; };
-		F7274FEF1E6EB6F400C241B6 /* Constant.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7274FEC1E6EB6F400C241B6 /* Constant.swift */; };
-		F7274FF01E6EB6F400C241B6 /* Constant.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7274FEC1E6EB6F400C241B6 /* Constant.swift */; };
 		F72AAECA1E5C60C700BB17E1 /* AHKActionSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = F72AAEC31E5C60C700BB17E1 /* AHKActionSheet.m */; };
 		F72AAECB1E5C60C700BB17E1 /* AHKActionSheetViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F72AAEC51E5C60C700BB17E1 /* AHKActionSheetViewController.m */; };
 		F72AAECC1E5C60C700BB17E1 /* UIImage+AHKAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = F72AAEC71E5C60C700BB17E1 /* UIImage+AHKAdditions.m */; };
@@ -1014,7 +1010,6 @@
 		F721372F1BAFF0920012B613 /* CCTemplates.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTemplates.h; sourceTree = "<group>"; };
 		F72137301BAFF0920012B613 /* CCTemplates.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTemplates.m; sourceTree = "<group>"; };
 		F7229B491DF71BB300E8C4E7 /* AUTHORS */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AUTHORS; sourceTree = SOURCE_ROOT; };
-		F7274FEC1E6EB6F400C241B6 /* Constant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Constant.swift; sourceTree = "<group>"; };
 		F7296A601C8880C9001A7809 /* CCCellShareExt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCCellShareExt.h; sourceTree = "<group>"; };
 		F7296A611C8880C9001A7809 /* CCCellShareExt.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCCellShareExt.m; sourceTree = "<group>"; };
 		F7296A621C8880C9001A7809 /* CCCellShareExt.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CCCellShareExt.xib; sourceTree = "<group>"; };
@@ -3098,7 +3093,6 @@
 			isa = PBXGroup;
 			children = (
 				F7C742D31E7BD36600D9C973 /* Supporting Files */,
-				F7274FEC1E6EB6F400C241B6 /* Constant.swift */,
 				F7C1CDDA1E6DFC6F005D92BE /* CCNextcloudConstant.h */,
 				F7C1CDDB1E6DFC6F005D92BE /* CCNextcloudImages.h */,
 				F76B3CCD1EAE01BD00921AC9 /* NCColor.swift */,
@@ -3937,7 +3931,6 @@
 				F71459BA1D12E3B700CAFEEC /* NSString+TruncateToWidth.m in Sources */,
 				F708CF9B1E56E8CC00271D8B /* TableAccount+CoreDataProperties.m in Sources */,
 				F71459BB1D12E3B700CAFEEC /* NYXProgressiveImageView.m in Sources */,
-				F7274FEE1E6EB6F400C241B6 /* Constant.swift in Sources */,
 				F708CF981E56E8CC00271D8B /* TableAccount+CoreDataClass.m in Sources */,
 				F71459BC1D12E3B700CAFEEC /* Reachability.m in Sources */,
 				F73C41511E82E51F000137C0 /* TableExternalSites+CoreDataClass.m in Sources */,
@@ -4053,7 +4046,6 @@
 				F74344881E127F9C001CC831 /* UIImage+animatedGIF.m in Sources */,
 				F708CF7E1E56E8CC00271D8B /* TableGPS+CoreDataProperties.m in Sources */,
 				F73CC0771E813DFF006E3047 /* BKPasscodeViewController.m in Sources */,
-				F7274FEF1E6EB6F400C241B6 /* Constant.swift in Sources */,
 				F743448A1E127FF2001CC831 /* CCHud.m in Sources */,
 				F74344861E127F89001CC831 /* RNEncryptor.m in Sources */,
 				F73C41521E82E51F000137C0 /* TableExternalSites+CoreDataClass.m in Sources */,
@@ -4082,7 +4074,6 @@
 			files = (
 				F74344251E1264EE001CC831 /* FileProvider.swift in Sources */,
 				F76B3CD11EAE01BD00921AC9 /* NCColor.swift in Sources */,
-				F7274FF01E6EB6F400C241B6 /* Constant.swift in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -4152,7 +4143,6 @@
 				F77B0E161D118A16002130FE /* AFViewShaker.m in Sources */,
 				F762CB021EACB66200B38484 /* XLFormSliderCell.m in Sources */,
 				F77B0E1B1D118A16002130FE /* CCGraphics.m in Sources */,
-				F7274FED1E6EB6F400C241B6 /* Constant.swift in Sources */,
 				F7659A6E1DC0B760004860C4 /* PSTGridLayoutRow.m in Sources */,
 				F769D39B1E9E1506006DBBB4 /* CCLocalStorageCell.m in Sources */,
 				F762CB701EACB7D400B38484 /* ReaderThumbCache.m in Sources */,

+ 7 - 7
Picker/DocumentPickerViewController.swift

@@ -129,11 +129,11 @@ class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCN
         hud = CCHud.init(view: self.navigationController?.view)
         
         // COLOR
-        self.navigationController?.navigationBar.barTintColor = Constant.GlobalConstants.k_Color_NavigationBar
-        self.navigationController?.navigationBar.tintColor = Constant.GlobalConstants.k_Color_NavigationBar_Text
-        self.navigationController?.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: Constant.GlobalConstants.k_Color_NavigationBar_Text]
+        self.navigationController?.navigationBar.barTintColor = NCColor.sharedInstance.colorNavigationBar
+        self.navigationController?.navigationBar.tintColor = NCColor.sharedInstance.colorNavigationBarText
+        self.navigationController?.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: NCColor.sharedInstance.colorNavigationBarText]
         
-        self.tableView.separatorColor = Constant.GlobalConstants.k_Color_Seperator
+        self.tableView.separatorColor = NCColor.sharedInstance.colorSeperator
         self.tableView.tableFooterView = UIView()
         
         // Get Crypto Cloud Mode
@@ -156,7 +156,7 @@ class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCN
             
             // Color Button
             if parameterEncrypted == true {
-                encryptedButton.tintColor = Constant.GlobalConstants.k_Color_Cryptocloud
+                encryptedButton.tintColor = NCColor.sharedInstance.colorCryptocloud
             } else {
                 encryptedButton.tintColor = self.view.tintColor
                 
@@ -494,7 +494,7 @@ extension DocumentPickerViewController {
         parameterEncrypted = !parameterEncrypted!
         
         if parameterEncrypted == true {
-            encryptedButton.tintColor = Constant.GlobalConstants.k_Color_Cryptocloud
+            encryptedButton.tintColor = NCColor.sharedInstance.colorCryptocloud
         } else {
             encryptedButton.tintColor = self.view.tintColor
         }
@@ -621,7 +621,7 @@ extension DocumentPickerViewController {
         viewController.touchIDManager = touchIDManager
         viewController.title = title
         viewController.navigationItem.leftBarButtonItem = UIBarButtonItem.init(barButtonSystemItem: UIBarButtonSystemItem.cancel, target: self, action: #selector(passcodeViewCloseButtonPressed(sender:)))
-        viewController.navigationItem.leftBarButtonItem?.tintColor = Constant.GlobalConstants.k_Color_Cryptocloud
+        viewController.navigationItem.leftBarButtonItem?.tintColor = NCColor.sharedInstance.colorCryptocloud
         
         let navController = UINavigationController.init(rootViewController: viewController)
         self.present(navController, animated: true, completion: nil)

+ 0 - 56
iOSClient/Brand/Constant.swift

@@ -1,56 +0,0 @@
-//
-//  CCConstant.h
-//  Crypto Cloud Technology Nextcloud
-//
-//  Created by Marino Faggiana on 26/01/17.
-//  Copyright (c) 2017 TWS. All rights reserved.
-//
-//  Author Marino Faggiana <m.faggiana@twsweb.it>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-import UIKit
-
-class Constant: NSObject {
-    
-    struct GlobalConstants {
-        
-        // GLOBLE COLOR DEFINE
-        
-        static let k_Color_Brand: UIColor = UIColor(red: 0.0/255.0, green: 130.0/255.0, blue: 201.0/255.0, alpha: 1.0)              // BLU NC : #0082c9
-
-        static let k_Color_Nextcloud: UIColor = UIColor(red: 0.0/255.0, green: 130.0/255.0, blue: 201.0/255.0, alpha: 1.0)          // BLU NC : #0082c9
-
-        static let k_Color_Seperator: UIColor = UIColor(red: 235.0/255.0, green: 235.0/255.0, blue: 235.0/255.0, alpha: 1.0)
-        
-        static let k_Color_Cryptocloud: UIColor = UIColor(red: 241.0/255.0, green: 90.0/255.0, blue: 34.0/255.0, alpha: 1.0)
-        
-        static let k_Color_SelectBackgrond: UIColor = UIColor(red: 0.0/255.0, green: 130.0/255.0, blue: 201.0/255.0, alpha: 0.1)    // BLU NC : #0082c9
-        
-        static let k_Color_NavigationBar: UIColor = UIColor(red: 0.0/255.0, green: 130.0/255.0, blue: 201.0/255.0, alpha: 1.0)      // BLU NC : #0082c9
-        
-        static let k_Color_NavigationBar_Text: UIColor = UIColor.white
-        
-        static let k_Color_MoreNormal: UIColor = .black
-        
-        static let k_Color_MoreSettings: UIColor = .black
-        
-        static let k_Color_Table_Background: UIColor = UIColor.white
-        
-        // Response searchList
-        
-        static let kOrganizationFullName    = "FullName"
-    }
-}

+ 11 - 11
iOSClient/Create/CCCreateCloud.swift

@@ -28,8 +28,8 @@ import Foundation
 class CreateMenuAdd: NSObject {
     
     let fontButton = [NSFontAttributeName:UIFont(name: "HelveticaNeue", size: 16)!, NSForegroundColorAttributeName: UIColor(colorLiteralRed: 65.0/255.0, green: 64.0/255.0, blue: 66.0/255.0, alpha: 1.0)]
-    let fontEncrypted = [NSFontAttributeName:UIFont(name: "HelveticaNeue", size: 16)!, NSForegroundColorAttributeName: Constant.GlobalConstants.k_Color_Cryptocloud]
-    let fontCancel = [NSFontAttributeName:UIFont(name: "HelveticaNeue", size: 16)!, NSForegroundColorAttributeName: Constant.GlobalConstants.k_Color_NavigationBar]
+    let fontEncrypted = [NSFontAttributeName:UIFont(name: "HelveticaNeue", size: 16)!, NSForegroundColorAttributeName: NCColor.sharedInstance.colorCryptocloud] as [String : Any]
+    let fontCancel = [NSFontAttributeName:UIFont(name: "HelveticaNeue", size: 16)!, NSForegroundColorAttributeName: NCColor.sharedInstance.colorNavigationBar] as [String : Any]
     let fontDisable = [NSFontAttributeName:UIFont(name: "HelveticaNeue", size: 16)!, NSForegroundColorAttributeName: UIColor(colorLiteralRed: 65.0/255.0, green: 64.0/255.0, blue: 66.0/255.0, alpha: 1.0)]
 
     let colorLightGray = UIColor(colorLiteralRed: 250.0/255.0, green: 250.0/255.0, blue: 250.0/255.0, alpha: 1)
@@ -49,7 +49,7 @@ class CreateMenuAdd: NSObject {
         actionSheet.cancelButtonHeight = 50.0
         actionSheet.separatorHeight = 5.0
         
-        actionSheet.separatorColor = Constant.GlobalConstants.k_Color_Seperator
+        actionSheet.separatorColor = NCColor.sharedInstance.colorSeperator
         
         actionSheet.buttonTextAttributes = fontButton
         actionSheet.encryptedButtonTextAttributes = fontEncrypted
@@ -95,7 +95,7 @@ class CreateMenuAdd: NSObject {
         actionSheet.cancelButtonHeight = 50.0
         actionSheet.separatorHeight = 5.0
         
-        actionSheet.separatorColor = Constant.GlobalConstants.k_Color_Seperator
+        actionSheet.separatorColor = NCColor.sharedInstance.colorSeperator
 
         actionSheet.buttonTextAttributes = fontButton
         actionSheet.encryptedButtonTextAttributes = fontEncrypted
@@ -143,7 +143,7 @@ class CreateMenuAdd: NSObject {
         actionSheet.cancelButtonHeight = 50.0
         actionSheet.separatorHeight = 5.0
         
-        actionSheet.separatorColor = Constant.GlobalConstants.k_Color_Seperator
+        actionSheet.separatorColor = NCColor.sharedInstance.colorSeperator
 
         actionSheet.buttonTextAttributes = fontButton
         actionSheet.encryptedButtonTextAttributes = fontEncrypted
@@ -365,9 +365,9 @@ class CreateFormUploadAssets: XLFormViewController, CCMoveDelegate {
         self.navigationItem.leftBarButtonItem = cancelButton
         self.navigationItem.rightBarButtonItem = saveButton
         
-        self.navigationController?.navigationBar.barTintColor = Constant.GlobalConstants.k_Color_NavigationBar
-        self.navigationController?.navigationBar.tintColor = Constant.GlobalConstants.k_Color_NavigationBar_Text
-        self.navigationController?.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: Constant.GlobalConstants.k_Color_NavigationBar_Text]
+        self.navigationController?.navigationBar.barTintColor = NCColor.sharedInstance.colorNavigationBar
+        self.navigationController?.navigationBar.tintColor = NCColor.sharedInstance.colorNavigationBarText
+        self.navigationController?.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: NCColor.sharedInstance.colorNavigationBarText]
         
         self.tableView.separatorStyle = UITableViewCellSeparatorStyle.none
         
@@ -512,9 +512,9 @@ class CreateFormUploadAssets: XLFormViewController, CCMoveDelegate {
         let viewController : CCMove = navigationController.topViewController as! CCMove
         
         viewController.delegate = self;
-        viewController.tintColor = Constant.GlobalConstants.k_Color_NavigationBar_Text
-        viewController.barTintColor = Constant.GlobalConstants.k_Color_NavigationBar
-        viewController.tintColorTitle = Constant.GlobalConstants.k_Color_NavigationBar_Text
+        viewController.tintColor = NCColor.sharedInstance.colorNavigationBarText
+        viewController.barTintColor = NCColor.sharedInstance.colorNavigationBar
+        viewController.tintColorTitle = NCColor.sharedInstance.colorNavigationBarText
         viewController.move.title = NSLocalizedString("_select_", comment: "");
         viewController.networkingOperationQueue =  appDelegate.netQueue
         

+ 1 - 1
iOSClient/Login/CCLoginWeb.swift

@@ -35,7 +35,7 @@ public class CCLoginWeb: UIViewController {
             doneButtonVisible = true
         }
         
-        let webVC = SwiftModalWebVC(urlString: k_loginBaseUrl, theme: .custom, color: Constant.GlobalConstants.k_Color_NavigationBar, colorText: Constant.GlobalConstants.k_Color_NavigationBar_Text, doneButtonVisible: doneButtonVisible)
+        let webVC = SwiftModalWebVC(urlString: k_loginBaseUrl, theme: .custom, color: NCColor.sharedInstance.colorNavigationBar, colorText: NCColor.sharedInstance.colorNavigationBarText, doneButtonVisible: doneButtonVisible)
         webVC.delegateWeb = self
 
         vc.present(webVC, animated: false, completion: nil)

+ 4 - 4
iOSClient/Main/CCMore.swift

@@ -50,7 +50,7 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
         tableView.delegate = self
         tableView.dataSource = self
         
-        tableView.separatorColor = Constant.GlobalConstants.k_Color_Seperator
+        tableView.separatorColor = NCColor.sharedInstance.colorSeperator
         
         imageLogo.image = UIImage.init(named: image_brandMenuMoreBackground)
         
@@ -230,7 +230,7 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
 
         // change color selection and disclosure indicator
         let selectionColor : UIView = UIView.init()
-        selectionColor.backgroundColor = Constant.GlobalConstants.k_Color_SelectBackgrond
+        selectionColor.backgroundColor = NCColor.sharedInstance.colorSelectBackgrond
         cell.selectedBackgroundView = selectionColor
         
         cell.accessoryType = UITableViewCellAccessoryType.disclosureIndicator
@@ -242,7 +242,7 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
             
             cell.imageIcon?.image = UIImage.init(named: item.icon)
             cell.labelText?.text = NSLocalizedString(item.name, comment: "")
-            cell.labelText.textColor = Constant.GlobalConstants.k_Color_MoreNormal
+            cell.labelText.textColor = NCColor.sharedInstance.colorMoreNormal
 
         }
         
@@ -253,7 +253,7 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
             
             cell.imageIcon?.image = UIImage.init(named: item.icon)
             cell.labelText?.text = NSLocalizedString(item.name, comment: "")
-            cell.labelText.textColor = Constant.GlobalConstants.k_Color_MoreSettings
+            cell.labelText.textColor = NCColor.sharedInstance.colorMoreSettings
         }
         
         return cell

+ 5 - 5
iOSClient/Notification/CCNotification.swift

@@ -33,13 +33,13 @@ class CCNotification: UITableViewController, OCNetworkingDelegate {
         super.viewDidLoad()
         
         self.navigationController?.navigationBar.topItem?.title = NSLocalizedString("_notification_", comment: "")
-        self.navigationController?.navigationBar.barTintColor = Constant.GlobalConstants.k_Color_NavigationBar
-        self.navigationController?.navigationBar.tintColor = Constant.GlobalConstants.k_Color_NavigationBar_Text
-        self.navigationController?.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: Constant.GlobalConstants.k_Color_NavigationBar_Text]
+        self.navigationController?.navigationBar.barTintColor = NCColor.sharedInstance.colorNavigationBar
+        self.navigationController?.navigationBar.tintColor = NCColor.sharedInstance.colorNavigationBarText
+        self.navigationController?.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: NCColor.sharedInstance.colorNavigationBarText]
 
         self.navigationItem.setRightBarButton(UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(viewClose)), animated: true)
         
-        self.tableView.separatorColor = Constant.GlobalConstants.k_Color_Seperator
+        self.tableView.separatorColor = NCColor.sharedInstance.colorSeperator
         self.tableView.tableFooterView = UIView()
 
         // Register to receive notification reload data
@@ -159,7 +159,7 @@ class CCNotification: UITableViewController, OCNetworkingDelegate {
         let cell = self.tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! CCNotificationCell
         
         let selectionColor : UIView = UIView.init()
-        selectionColor.backgroundColor = Constant.GlobalConstants.k_Color_SelectBackgrond
+        selectionColor.backgroundColor = NCColor.sharedInstance.colorSelectBackgrond
         cell.selectedBackgroundView = selectionColor
         
         if self.resultSearchController.isActive {