marinofaggiana 5 years ago
parent
commit
d98e7d6804
3 changed files with 15 additions and 8 deletions
  1. 2 1
      iOSClient/AppDelegate.h
  2. 11 4
      iOSClient/AppDelegate.m
  3. 2 3
      iOSClient/Settings/CCSettings.m

+ 2 - 1
iOSClient/AppDelegate.h

@@ -169,7 +169,8 @@
 
 // Theming Color
 - (void)settingThemingColorBrand;
-- (void)changeTheming:(UIViewController *)vc;
+- (void)changeTheming:(UIViewController *)viewController;
+- (void)settingDarkMode;
 
 // Task Networking
 - (void)loadAutoDownloadUpload;

+ 11 - 4
iOSClient/AppDelegate.m

@@ -1028,13 +1028,13 @@ PKPushRegistry *pushRegistry;
     [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"changeTheming" object:nil];
 }
 
-- (void)changeTheming:(UIViewController *)vc
+- (void)changeTheming:(UIViewController *)viewController
 {
     // Change Navigation & TabBar color
-    vc.navigationController.navigationBar.barTintColor = NCBrandColor.sharedInstance.brand;
-    vc.tabBarController.tabBar.tintColor = NCBrandColor.sharedInstance.brandElement;
+    viewController.navigationController.navigationBar.barTintColor = NCBrandColor.sharedInstance.brand;
+    viewController.tabBarController.tabBar.tintColor = NCBrandColor.sharedInstance.brandElement;
     // Change bar bottom line shadow
-    vc.navigationController.navigationBar.shadowImage = [CCGraphics generateSinglePixelImageWithColor:NCBrandColor.sharedInstance.brand];
+    viewController.navigationController.navigationBar.shadowImage = [CCGraphics generateSinglePixelImageWithColor:NCBrandColor.sharedInstance.brand];
     
     // Change button Plus
     UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
@@ -1050,6 +1050,13 @@ PKPushRegistry *pushRegistry;
     [self.window setTintColor:NCBrandColor.sharedInstance.textView];
 }
 
+- (void)settingDarkMode
+{
+    [NCBrandColor.sharedInstance setDarkMode];
+    [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"changeTheming" object:nil];
+    [[NCMainCommon sharedInstance] createImagesThemingColor];
+}
+
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ===== Manager Passcode =====
 #pragma --------------------------------------------------------------------------------------------

+ 2 - 3
iOSClient/Settings/CCSettings.m

@@ -329,12 +329,11 @@
             [CCUtility setDarkMode:false];
         }
         
-        [NCBrandColor.sharedInstance setDarkMode];
+        [appDelegate settingDarkMode];
+        
         [appDelegate aspectNavigationControllerBar:self.navigationController.navigationBar online:[appDelegate.reachability isReachable] hidden:NO];
         [appDelegate aspectTabBar:self.tabBarController.tabBar hidden:NO];
         self.tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
-        [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"changeTheming" object:nil];
-        [[NCMainCommon sharedInstance] createImagesThemingColor];
         [self initializeForm];
         [self reloadForm];
     }