Browse Source

clear code

Marino Faggiana 8 years ago
parent
commit
80e327d9ca
3 changed files with 47 additions and 42 deletions
  1. 0 4
      Nextcloud.xcodeproj/project.pbxproj
  2. 18 0
      iOSClient/Brand/NCBrand.swift
  3. 29 38
      iOSClient/Move/CCMove.m

+ 0 - 4
Nextcloud.xcodeproj/project.pbxproj

@@ -155,8 +155,6 @@
 		F73F537F1E929C8500F8678D /* CCMore.swift in Sources */ = {isa = PBXBuildFile; fileRef = F73F537E1E929C8500F8678D /* CCMore.swift */; };
 		F74344171E1264EE001CC831 /* DocumentPickerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F74344161E1264EE001CC831 /* DocumentPickerViewController.swift */; };
 		F74344251E1264EE001CC831 /* FileProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = F74344241E1264EE001CC831 /* FileProvider.swift */; };
-		F743444A1E126B4D001CC831 /* CCMove.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D02A471C5F9E4400D6F972 /* CCMove.m */; };
-		F743444B1E126B69001CC831 /* CCMove.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F7D02A481C5F9E4400D6F972 /* CCMove.storyboard */; };
 		F74344541E1277D8001CC831 /* libownCloudiOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F71E67FC1DC1F76F003BA52B /* libownCloudiOS.a */; };
 		F74344551E1277E2001CC831 /* libMagicalRecord.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F7B61E9B1DC13C20009E938F /* libMagicalRecord.a */; };
 		F74344561E12784A001CC831 /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F70A63061D5B3467004E2AA5 /* libcrypto.a */; };
@@ -3719,7 +3717,6 @@
 				F7FC88FB1E141A34006D0506 /* BKPasscodeView.strings in Resources */,
 				F7FC88FC1E141A39006D0506 /* Localizable.strings in Resources */,
 				F7D2677C1E157053005ACB7E /* Images.xcassets in Resources */,
-				F743444B1E126B69001CC831 /* CCMove.storyboard in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -4020,7 +4017,6 @@
 				F708CF841E56E8CC00271D8B /* TableDirectory+CoreDataProperties.m in Sources */,
 				F74344821E127F68001CC831 /* MBProgressHUD.m in Sources */,
 				F708CF7B1E56E8CC00271D8B /* TableGPS+CoreDataClass.m in Sources */,
-				F743444A1E126B4D001CC831 /* CCMove.m in Sources */,
 				F743448B1E12800D001CC831 /* CCCertificate.m in Sources */,
 				F743447D1E127ECB001CC831 /* AESCrypt.m in Sources */,
 				F743447E1E127ECE001CC831 /* NSData+Base64.m in Sources */,

+ 18 - 0
iOSClient/Brand/NCBrand.swift

@@ -68,4 +68,22 @@ class NCBrandImages: NSObject {
     public var menuMoreImage:           String = "menuMoreImage"
 }
 
+/*
+class NCBrandText: NSObject {
+    
+    static let sharedInstance: NCBrandText = {
+        let instance = NCBrandText()
+        return instance
+    }()
+    
+    public var brand:                           String = "Nextcloud"
+    public var mailBrand:                       String = "ios@nextcloud.com"
+    public var copyrightNextcloudiOS :          String = "Nextcloud for iOS %@ © 2017 T.W.S. Inc."
+    public var copyrightNextcloudServer:        String = "Nextcloud Server %@"
+    public var loginBaseUrl:                    String = "https://cloud.twsweb.it"
+    public var pushNotificationServer:          String = "https://push-notifications.nextcloud.com"
+    public var loginButtonLabelLink:            String = "https://nextcloud.com/providers"
+    public var webLoginAutenticationProtocol:   String = ""
+}
+*/
 

+ 29 - 38
iOSClient/Move/CCMove.m

@@ -24,33 +24,24 @@
 #import "CCMove.h"
 
 #ifndef EXTENSION
-#import "AppDelegate.h"
-#endif
 
-//Color
-#define COLOR_BRAND                             [UIColor colorWithRed:0.0/255.0 green:130.0/255.0 blue:201.0/255.0 alpha:1.0]       // BLU NC : #0082c9
-#define COLOR_SELECT_BACKGROUND                 [UIColor colorWithRed:0.0/255.0 green:130.0/255.0 blue:201.0/255.0 alpha:0.1]       // BLU NC : #0082c9
-#define COLOR_TRANSFER_BACKGROUND               [UIColor colorWithRed:178.0/255.0 green:244.0/255.0 blue:258.0/255.0 alpha:0.1]
-#define COLOR_GROUPBY_BAR                       [UIColor colorWithRed:0.0/255.0 green:130.0/255.0 blue:201.0/255.0 alpha:0.2]       // BLU NC : #0082c9
-#define COLOR_GROUPBY_BAR_NO_BLUR               [UIColor colorWithRed:0.0/255.0 green:130.0/255.0 blue:201.0/255.0 alpha:0.3]       // BLU NC : #0082c9
-#define COLOR_NAVIGATIONBAR                     [UIColor colorWithRed:0.0/255.0 green:130.0/255.0 blue:201.0/255.0 alpha:1.0]       // BLU NC : #0082c9
-#define COLOR_NAVIGATIONBAR_SHARE               [UIColor colorWithRed:0.0/255.0 green:130.0/255.0 blue:201.0/255.0 alpha:1.0]
-#define COLOR_NAVIGATIONBAR_TEXT                [UIColor whiteColor]
-#define COLOR_NAVIGATIONBAR_PROGRESS            [UIColor whiteColor]
-#define COLOR_TABBAR                            [UIColor whiteColor]
-#define COLOR_TABBAR_TEXT                       [UIColor colorWithRed:0.0/255.0 green:130.0/255.0 blue:201.0/255.0 alpha:1.0]       // BLU NC : #0082c9
-#define COLOR_BACKGROUND_MENU                   [UIColor whiteColor]
-#define COLOR_BACKGROUND_PAGECONTROL            [UIColor colorWithRed:247.0/255.0 green:247.0/255.0 blue:247.0/255.0 alpha:1.0]
-#define COLOR_PAGECONTROL_INDICATOR             [UIColor colorWithRed:0.0/255.0 green:130.0/255.0 blue:201.0/255.0 alpha:1.0]       // BLU NC : #0082c9
-#define COLOR_CRYPTOCLOUD                       [UIColor colorWithRed:241.0/255.0 green:90.0/255.0 blue:34.0/255.0 alpha:1.0]
-#define COLOR_TEXT_ANTHRACITE                   [UIColor colorWithRed:65.0/255.0 green:64.0/255.0 blue:66.0/255.0 alpha:1.0]        // #414042
-#define COLOR_TEXT_NO_CONNECTION                [UIColor colorWithRed:204.0/255.0 green:204.0/255.0 blue:204.0/255.0 alpha:1.0]
-#define COLOR_SEPARATOR_TABLE                   [UIColor colorWithRed:235.0/255.0 green:235.0/255.0 blue:235.0/255.0 alpha:1.0]     // iOS 7
-#define COLOR_BACKGROUND_MESSAGE_INFO           [UIColor colorWithRed:0.0/255.0 green:130.0/255.0 blue:201.0/255.0 alpha:1.0]       // BLU NC : #0082c9
-#define COLOR_CONTROL_CENTER                    [UIColor colorWithRed:0.0/255.0 green:130.0/255.0 blue:201.0/255.0 alpha:1.0]       // BLU NC : #0082c9
-#define COLOR_REFRESH_CONTROL                   [UIColor colorWithRed:0.0/255.0 green:130.0/255.0 blue:201.0/255.0 alpha:1.0]       // BLU NC : #0082c9
-#define COLOR_WINDOW_TINTCOLOR                  [UIColor colorWithRed:0.0/255.0 green:130.0/255.0 blue:201.0/255.0 alpha:1.0]       // BLU NC : #0082c9
-#define COLOR_TABLE_BACKGROUND                  [UIColor whiteColor]
+    #import "AppDelegate.h"
+
+    #ifdef CUSTOM_BUILD
+    #import "CustomSwift.h"
+    #else
+    #import "Nextcloud-Swift.h"
+    #endif
+
+#else
+
+    #ifdef CUSTOM_BUILD
+    #import "CustomSwiftShare.h"
+    #else
+    #import "Share-Swift.h"
+    #endif
+
+#endif
 
 @interface CCMove ()
 {    
@@ -107,25 +98,25 @@
 
     // TableView : at the end of rows nothing
     self.tableView.tableFooterView = [UIView new];
-    self.tableView.separatorColor = COLOR_SEPARATOR_TABLE;
+    
+    self.tableView.separatorColor =  NCBrandColor.sharedInstance.seperator;
 
     [self.cancel setTitle:NSLocalizedString(@"_cancel_", nil)];
     [self.create setTitle:NSLocalizedString(@"_create_folder_", nil)];
 
     if (![_serverUrl length]) {
         
-        /*_serverUrl = [CCUtility getHomeServerUrlActiveUrl:activeUrl];
-        UIImageView *image = [[UIImageView alloc] initWithImage:[UIImage imageNamed:image_brandNavigationController]];
+        _serverUrl = [CCUtility getHomeServerUrlActiveUrl:activeUrl];
+        UIImageView *image = [[UIImageView alloc] initWithImage:[UIImage imageNamed: NCBrandImages.sharedInstance.navigationLogo]];
         [self.navigationController.navigationBar.topItem setTitleView:image];
         self.title = @"Home";
-        */
         
     } else {
         
         UILabel* label = [[UILabel alloc] initWithFrame:CGRectMake(0,0, self.navigationItem.titleView.frame.size.width, 40)];
         label.text = self.passMetadata.fileNamePrint;
         
-        if (self.passMetadata.cryptated) label.textColor = COLOR_CRYPTOCLOUD;
+        if (self.passMetadata.cryptated) label.textColor = NCBrandColor.sharedInstance.cryptocloud;
         else label.textColor = self.tintColorTitle;
         
         label.backgroundColor =[UIColor clearColor];
@@ -134,11 +125,11 @@
     }
     
     // Toolbar Color
-    self.navigationController.navigationBar.barTintColor = COLOR_NAVIGATIONBAR;
-    self.navigationController.navigationBar.tintColor = COLOR_NAVIGATIONBAR_TEXT;
+    self.navigationController.navigationBar.barTintColor = NCBrandColor.sharedInstance.navigationBar;
+    self.navigationController.navigationBar.tintColor = NCBrandColor.sharedInstance.navigationBarText;
     
-    self.navigationController.toolbar.barTintColor = COLOR_TABBAR;
-    self.navigationController.toolbar.tintColor = COLOR_TABBAR_TEXT;
+    self.navigationController.toolbar.barTintColor = NCBrandColor.sharedInstance.tabBar;
+    self.navigationController.toolbar.tintColor = NCBrandColor.sharedInstance.tabBarText;
     
     // read folder
     [self readFolder];
@@ -449,9 +440,9 @@
     
     // colors
     if (metadata.cryptated) {
-        cell.textLabel.textColor = COLOR_CRYPTOCLOUD;
+        cell.textLabel.textColor = NCBrandColor.sharedInstance.cryptocloud;
     } else {
-        cell.textLabel.textColor = COLOR_TEXT_ANTHRACITE;
+        cell.textLabel.textColor = [UIColor blackColor];
     }
     
     cell.detailTextLabel.text = @"";
@@ -512,7 +503,7 @@
             
             viewController.title = NSLocalizedString(@"_folder_blocked_", nil);
             viewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(passcodeViewCloseButtonPressed:)];
-            viewController.navigationItem.leftBarButtonItem.tintColor = COLOR_CRYPTOCLOUD;
+            viewController.navigationItem.leftBarButtonItem.tintColor = NCBrandColor.sharedInstance.cryptocloud;
             
             UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController];
             [self presentViewController:navController animated:YES completion:nil];