Browse Source

change system logo theming

Marino Faggiana 6 years ago
parent
commit
2b057e45e5

+ 0 - 23
iOSClient/Brand/Custom.xcassets/navigationLogoOffline.imageset/Contents.json

@@ -1,23 +0,0 @@
-{
-  "images" : [
-    {
-      "idiom" : "universal",
-      "filename" : "navigationLogoOffline.png",
-      "scale" : "1x"
-    },
-    {
-      "idiom" : "universal",
-      "filename" : "navigationLogoOffline@2x.png",
-      "scale" : "2x"
-    },
-    {
-      "idiom" : "universal",
-      "filename" : "navigationLogoOffline@3x.png",
-      "scale" : "3x"
-    }
-  ],
-  "info" : {
-    "version" : 1,
-    "author" : "xcode"
-  }
-}

BIN
iOSClient/Brand/Custom.xcassets/navigationLogoOffline.imageset/navigationLogoOffline.png


BIN
iOSClient/Brand/Custom.xcassets/navigationLogoOffline.imageset/navigationLogoOffline@2x.png


BIN
iOSClient/Brand/Custom.xcassets/navigationLogoOffline.imageset/navigationLogoOffline@3x.png


+ 0 - 0
iOSClient/Brand/Custom.xcassets/navigationLogo.imageset/Contents.json → iOSClient/Brand/Custom.xcassets/themingLogo.imageset/Contents.json


+ 0 - 0
iOSClient/Brand/Custom.xcassets/navigationLogo.imageset/navigationLogo.png → iOSClient/Brand/Custom.xcassets/themingLogo.imageset/navigationLogo.png


+ 0 - 0
iOSClient/Brand/Custom.xcassets/navigationLogo.imageset/navigationLogo@2x.png → iOSClient/Brand/Custom.xcassets/themingLogo.imageset/navigationLogo@2x.png


+ 0 - 0
iOSClient/Brand/Custom.xcassets/navigationLogo.imageset/navigationLogo@3x.png → iOSClient/Brand/Custom.xcassets/themingLogo.imageset/navigationLogo@3x.png


+ 5 - 5
iOSClient/Main/CCMain.m

@@ -157,7 +157,7 @@
     // Back Button
     if ([_serverUrl isEqualToString:[CCUtility getHomeServerUrlActiveUrl:appDelegate.activeUrl]]) {
         
-        UIImage *backButtonImage = [UIImage imageNamed:@"navigationLogo"];
+        UIImage *backButtonImage = [UIImage imageNamed:@"themingLogo"];
         backButtonImage = [backButtonImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
         
         self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithImage:backButtonImage style:UIBarButtonItemStylePlain target:nil action:nil];
@@ -564,7 +564,7 @@
             self.navigationItem.title = nil;
             
             if ([appDelegate.reachability isReachable] == NO) {
-                _ImageTitleHomeCryptoCloud = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"navigationLogoOffline"]];
+                _ImageTitleHomeCryptoCloud = [[UIImageView alloc] initWithImage:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"themingLogo"] multiplier:2 color:[NCBrandColor sharedInstance].icon]];
             } else {
                 
                 if ([NCBrandOptions sharedInstance].use_themingColor) {
@@ -572,12 +572,12 @@
                     tableCapabilities *capabilities = [[NCManageDatabase sharedInstance] getCapabilites];
                     
                     if ([capabilities.themingColor isEqualToString:@"#FFFFFF"])
-                        _ImageTitleHomeCryptoCloud = [[UIImageView alloc] initWithImage:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"navigationLogo"] multiplier:2 color:[UIColor blackColor]]];
+                        _ImageTitleHomeCryptoCloud = [[UIImageView alloc] initWithImage:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"themingLogo"] multiplier:2 color:[UIColor blackColor]]];
                     else
-                        _ImageTitleHomeCryptoCloud = [[UIImageView alloc] initWithImage:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"navigationLogo"] multiplier:2 color:[UIColor whiteColor]]];
+                        _ImageTitleHomeCryptoCloud = [[UIImageView alloc] initWithImage:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"themingLogo"] multiplier:2 color:[UIColor whiteColor]]];
                 } else {
                     
-                    _ImageTitleHomeCryptoCloud = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"navigationLogo"]];
+                    _ImageTitleHomeCryptoCloud = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"themingLogo"]];
                 }
             }
             

+ 2 - 2
iOSClient/Move/CCMove.m

@@ -81,9 +81,9 @@
         
         tableCapabilities *capabilities = [[NCManageDatabase sharedInstance] getCapabilites];
         if ([capabilities.themingColor isEqualToString:@"#FFFFFF"])
-            image = [[UIImageView alloc] initWithImage:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"navigationLogo"] multiplier:2 color:[UIColor blackColor]]];
+            image = [[UIImageView alloc] initWithImage:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"themingLogo"] multiplier:2 color:[UIColor blackColor]]];
         else
-            image = [[UIImageView alloc] initWithImage:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"navigationLogo"] multiplier:2 color:[UIColor whiteColor]]];
+            image = [[UIImageView alloc] initWithImage:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"themingLogo"] multiplier:2 color:[UIColor whiteColor]]];
 
         [self.navigationController.navigationBar.topItem setTitleView:image];
         self.title = @"Home";

+ 7 - 7
iOSClient/Networking/NCService.swift

@@ -142,19 +142,19 @@ class NCService: NSObject, OCNetworkingDelegate {
             
             // ------ THEMING -----------------------------------------------------------------------
             
-            // theming logo
-            let fileNameThemingLogo = CCUtility.getStringUser(self.appDelegate.activeUser, activeUrl: self.appDelegate.activeUrl) + "-themingLogo.png"
-            NCUtility.sharedInstance.convertSVGtoPNGWriteToUserData(svgUrlString: capabilities!.themingLogo, fileName: fileNameThemingLogo, width: 40, rewrite: true)
-            
             if (NCBrandOptions.sharedInstance.use_themingBackground && capabilities!.themingBackground != "") {
                 
-                // Download Theming Background & Change Theming color
+                // Download Logo
+                let fileNameThemingLogo = CCUtility.getStringUser(self.appDelegate.activeUser, activeUrl: self.appDelegate.activeUrl) + "-themingLogo.png"
+                NCUtility.sharedInstance.convertSVGtoPNGWriteToUserData(svgUrlString: capabilities!.themingLogo, fileName: fileNameThemingLogo, width: 80, rewrite: true)
+                
+                // Download Theming Background
                 DispatchQueue.global().async {
                 
-                    let address = capabilities!.themingBackground!.addingPercentEncoding(withAllowedCharacters: .urlFragmentAllowed)!
+                    let backgroundURL = capabilities!.themingBackground!.addingPercentEncoding(withAllowedCharacters: .urlFragmentAllowed)!
                     let fileNamePath = CCUtility.getDirectoryUserData() + "/" + CCUtility.getStringUser(self.appDelegate.activeUser, activeUrl: self.appDelegate.activeUrl) + "-themingBackground.png"
 
-                    guard let imageData = try? Data(contentsOf: URL(string: address)!) else {
+                    guard let imageData = try? Data(contentsOf: URL(string: backgroundURL)!) else {
                         DispatchQueue.main.async {
                             self.appDelegate.settingThemingColorBrand()
                         }