marinofaggiana 5 years ago
parent
commit
3ea68e025b
2 changed files with 22 additions and 22 deletions
  1. 22 15
      iOSClient/Main/CCDetail.m
  2. 0 7
      iOSClient/Main/CCSplit.m

+ 22 - 15
iOSClient/Main/CCDetail.m

@@ -59,7 +59,17 @@
 -  (id)initWithCoder:(NSCoder *)aDecoder
 {
     if (self = [super initWithCoder:aDecoder])  {
+        
         appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+
+        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTheming) name:@"changeTheming" object:nil];
+
+        self.metadataDetail = [[tableMetadata alloc] init];
+        self.photos = [[NSMutableArray alloc] init];
+        self.photoDataSource = [NSMutableArray new];
+        indexNowVisible = -1;
+        ocIdNowVisible = nil;
+
         appDelegate.activeDetail = self;
     }
     return self;
@@ -72,23 +82,23 @@
 - (void)viewDidLoad
 {
     [super viewDidLoad];
-
-    self.metadataDetail = [[tableMetadata alloc] init];
-    self.photos = [[NSMutableArray alloc] init];
-    self.photoDataSource = [NSMutableArray new];
-    indexNowVisible = -1;
-    ocIdNowVisible = nil;
-    self.imageBackground.image = [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"logo"] multiplier:2 color:[NCBrandColor.sharedInstance.brand colorWithAlphaComponent:0.4]];
     
-    // Notification
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(insertGeocoderLocation:) name:@"insertGeocoderLocation" object:nil];
+
+    self.imageBackground.image = [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"logo"] multiplier:2 color:[NCBrandColor.sharedInstance.brand colorWithAlphaComponent:0.4]];
     
     // Change bar bottom line shadow and remove title back button <"title"
     self.navigationController.navigationBar.topItem.title = @"";
-    
-    // changeTheming
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTheming) name:@"changeTheming" object:nil];
-    [self changeTheming];
+    self.navigationController.navigationBar.translucent = NO;
+    self.navigationController.navigationBar.barTintColor = NCBrandColor.sharedInstance.brand;
+    self.navigationController.navigationBar.tintColor = NCBrandColor.sharedInstance.brandText;
+    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName : NCBrandColor.sharedInstance.brandText}];
+    self.navigationController.navigationBar.shadowImage = [CCGraphics generateSinglePixelImageWithColor:NCBrandColor.sharedInstance.brand];
+    [self.navigationController.navigationBar setAlpha:1];
+
+    // TabBar
+    self.tabBarController.tabBar.hidden = YES;
+    self.tabBarController.tabBar.translucent = YES;
     
     // Open View
     if ([self.metadataDetail.fileNameView length] > 0 || [self.metadataDetail.serverUrl length] > 0 || [self.metadataDetail.ocId length] > 0) {        
@@ -140,9 +150,6 @@
         self.toolbar.tintColor = NCBrandColor.sharedInstance.brandElement;
     }
     
-    // TabBar
-    self.tabBarController.tabBar.hidden = YES;
-    self.tabBarController.tabBar.translucent = YES;
     self.view.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
 }
 

+ 0 - 7
iOSClient/Main/CCSplit.m

@@ -64,10 +64,6 @@
     UITabBarController *tabBarController = [self.viewControllers firstObject];
     [appDelegate createTabBarController:tabBarController];
     
-    // Settings Navigation Controller
-//    UINavigationController *navigationController = [self.viewControllers lastObject];
-//    [appDelegate aspectNavigationControllerBar:navigationController.navigationBar];
-    
     [self inizialize];    
 }
 
@@ -194,9 +190,6 @@
     // No detail view present
     UINavigationController *secondaryNC = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"CCDetailNC"];
     
-    // Color
-//    [appDelegate aspectNavigationControllerBar:secondaryNC.navigationBar];
-    
     // Ensure back button is enabled
     UIViewController *detailViewController = [secondaryNC visibleViewController];