marinofaggiana 5 ani în urmă
părinte
comite
a5b4f5a941

+ 14 - 10
iOSClient/Activity/NCActivity.swift

@@ -46,6 +46,8 @@ class NCActivity: UIViewController, DZNEmptyDataSetSource, DZNEmptyDataSetDelega
     override func viewDidLoad() {
         super.viewDidLoad()
     
+        self.title = NSLocalizedString("_activity_", comment: "")
+
         // empty Data Source
         tableView.emptyDataSetDelegate = self;
         tableView.emptyDataSetSource = self;
@@ -55,16 +57,9 @@ class NCActivity: UIViewController, DZNEmptyDataSetSource, DZNEmptyDataSetDelega
         tableView.tableFooterView = UIView()
         tableView.contentInset = insets
         
-        // Color
-        appDelegate.aspectNavigationControllerBar(self.navigationController?.navigationBar)
-        appDelegate.aspectTabBar(self.tabBarController?.tabBar)
-        if filterFileId == nil {
-            tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundView
-        } else {
-            tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
-        }
-        
-        self.title = NSLocalizedString("_activity_", comment: "")
+        // changeTheming
+        NotificationCenter.default.addObserver(self, selector: #selector(self.changeTheming), name: NSNotification.Name(rawValue: "changeTheming"), object: nil)
+        changeTheming()
     }
     
     override func viewWillAppear(_ animated: Bool) {
@@ -78,6 +73,15 @@ class NCActivity: UIViewController, DZNEmptyDataSetSource, DZNEmptyDataSetDelega
         super.viewWillDisappear(animated)
     }
     
+    @objc func changeTheming() {
+        appDelegate.changeTheming(self, tableView: tableView, collectionView: nil)
+        if filterFileId == nil {
+            tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundView
+        } else {
+            tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
+        }
+    }
+    
     // MARK: DZNEmpty
     
     func verticalOffset(forEmptyDataSet scrollView: UIScrollView!) -> CGFloat {

+ 0 - 2
iOSClient/AppDelegate.h

@@ -158,8 +158,6 @@
 
 // TabBarController
 - (void)createTabBarController:(UITabBarController *)tabBarController;
-- (void)aspectNavigationControllerBar:(UINavigationBar *)nav;
-- (void)aspectTabBar:(UITabBar *)tab;
 - (void)plusButtonVisibile:(BOOL)visible;
 - (void)selectedTabBarController:(NSInteger)index;
 - (NSString *)getTabBarControllerActiveServerUrl;

+ 24 - 39
iOSClient/AppDelegate.m

@@ -830,7 +830,7 @@ PKPushRegistry *pushRegistry;
         }
     }
     
-    [self aspectTabBar:tabBarController.tabBar];
+    //[self aspectTabBar:tabBarController.tabBar];
     
     // File
     item = [tabBarController.tabBar.items objectAtIndex: k_tabBarApplicationIndexFile];
@@ -894,30 +894,6 @@ PKPushRegistry *pushRegistry;
     [tabBarController.view addConstraint:constraint];
 }
 
-- (void)aspectNavigationControllerBar:(UINavigationBar *)nav
-{
-    nav.translucent = NO;
-    nav.barTintColor = NCBrandColor.sharedInstance.brand;
-    nav.tintColor = NCBrandColor.sharedInstance.brandText;
-    [nav setTitleTextAttributes:@{NSForegroundColorAttributeName : NCBrandColor.sharedInstance.brandText}];
-    // Change bar bottom line shadow
-    nav.shadowImage = [CCGraphics generateSinglePixelImageWithColor:NCBrandColor.sharedInstance.brand];
-    
-    if (![self.reachability isReachable])
-        [nav setTitleTextAttributes:@{NSForegroundColorAttributeName : NCBrandColor.sharedInstance.connectionNo}];
-        
-    [nav setAlpha:1];
-}
-
-- (void)aspectTabBar:(UITabBar *)tab
-{
-    tab.translucent = NO;
-    tab.barTintColor = NCBrandColor.sharedInstance.tabBar;
-    tab.tintColor = NCBrandColor.sharedInstance.brandElement;
-        
-    [tab setAlpha:1];
-}
-
 - (void)plusButtonVisibile:(BOOL)visible
 {
     UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
@@ -1026,27 +1002,36 @@ PKPushRegistry *pushRegistry;
 
 - (void)changeTheming:(UIViewController *)viewController tableView:(UITableView *)tableView collectionView:(UICollectionView *)collectionView
 {
-    // Change Navigation & TabBar color
-    viewController.navigationController.navigationBar.barTintColor = NCBrandColor.sharedInstance.brand;
-    viewController.tabBarController.tabBar.tintColor = NCBrandColor.sharedInstance.brandElement;
-    // Change bar bottom line shadow
-    viewController.navigationController.navigationBar.shadowImage = [CCGraphics generateSinglePixelImageWithColor:NCBrandColor.sharedInstance.brand];
+    // NavigationBar
+    if (viewController.navigationController.navigationBar) {
+        viewController.navigationController.navigationBar.translucent = false;
+        viewController.navigationController.navigationBar.barTintColor = NCBrandColor.sharedInstance.brand;
+        viewController.navigationController.navigationBar.tintColor = NCBrandColor.sharedInstance.brandText;
+        if ([self.reachability isReachable]) {
+            [viewController.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName : NCBrandColor.sharedInstance.brandText}];
+        } else {
+            [viewController.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName : NCBrandColor.sharedInstance.connectionNo}];
+        }
+        viewController.navigationController.navigationBar.shadowImage = [CCGraphics generateSinglePixelImageWithColor:NCBrandColor.sharedInstance.brand];
+        [viewController.navigationController.navigationBar setAlpha:1];
+    }
     
-    // Change button Plus
+    //tabBar
+    if (viewController.tabBarController.tabBar) {
+        viewController.tabBarController.tabBar.translucent = NO;
+        viewController.tabBarController.tabBar.barTintColor = NCBrandColor.sharedInstance.tabBar;
+        viewController.tabBarController.tabBar.tintColor = NCBrandColor.sharedInstance.brandElement;
+        [viewController.tabBarController.tabBar setAlpha:1];
+    }
+    
+    //tabBar button Plus
     UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
     UITabBarController *tabBarController = [splitViewController.viewControllers firstObject];
-    
     UIButton *button = [tabBarController.view viewWithTag:99];
     UIImage *buttonImage = [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"tabBarPlus"] multiplier:3 color:NCBrandColor.sharedInstance.brandElement];
-    
     [button setBackgroundImage:buttonImage forState:UIControlStateNormal];
     [button setBackgroundImage:buttonImage forState:UIControlStateHighlighted];
-    
-    tabBarController.tabBar.translucent = NO;
-    tabBarController.tabBar.barTintColor = NCBrandColor.sharedInstance.tabBar;
-    tabBarController.tabBar.tintColor = NCBrandColor.sharedInstance.brandElement;
-            
-    // TableView
+                
     if (tableView) {
         tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
         tableView.separatorColor = NCBrandColor.sharedInstance.separator;

+ 9 - 27
iOSClient/Favorites/CCFavorites.m

@@ -51,12 +51,7 @@
 - (id)initWithCoder:(NSCoder *)aDecoder
 {
     if (self = [super initWithCoder:aDecoder])  {
-        
         appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
-
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(triggerProgressTask:) name:@"NotificationProgressTask" object:nil];
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTheming) name:@"changeTheming" object:nil];
-        
         appDelegate.activeFavorites = self;
     }
     return self;
@@ -93,22 +88,15 @@
     else
         self.title = NSLocalizedString(@"_favorites_", nil);
     
-    // Query data source
-    [self queryDatasource];
-}
+    // Notification
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(triggerProgressTask:) name:@"NotificationProgressTask" object:nil];
 
-- (void)viewWillAppear:(BOOL)animated
-{
-    [super viewWillAppear:animated];
-    
-    // Color
-    [appDelegate aspectNavigationControllerBar:self.navigationController.navigationBar];
-    [appDelegate aspectTabBar:self.tabBarController.tabBar];
-    self.tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
-    self.tableView.separatorColor = NCBrandColor.sharedInstance.separator;
+    // changeTheming
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTheming) name:@"changeTheming" object:nil];
+    [self changeTheming];
     
-    // Plus Button
-    [appDelegate plusButtonVisibile:true];
+    // Query data source
+    [self queryDatasource];
 }
 
 - (void)viewDidAppear:(BOOL)animated
@@ -118,18 +106,12 @@
     // Active Main
     appDelegate.activeFavorites = self;
     
-    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.001 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) {
-        [self reloadDatasource:nil action:k_action_NULL];
-    });
+    [self reloadDatasource:nil action:k_action_NULL];
 }
 
 - (void)changeTheming
 {
-    if (self.isViewLoaded && self.view.window)
-        [appDelegate changeTheming:self tableView:self.tableView collectionView:nil];
-    
-    // Reload Table View
-    [self.tableView reloadData];
+    [appDelegate changeTheming:self tableView:self.tableView collectionView:nil];
 }
 
 #pragma --------------------------------------------------------------------------------------------

+ 1 - 2
iOSClient/Login/CCLogin.m

@@ -43,7 +43,7 @@
 -  (id)initWithCoder:(NSCoder *)aDecoder
 {
     if (self = [super initWithCoder:aDecoder])  {
-        
+        appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(dismissCCLogin) name:@"dismissCCLogin" object:nil];
     }
     
@@ -54,7 +54,6 @@
 {
     [super viewDidLoad];
     
-    appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
     Ivar ivar =  class_getInstanceVariable([UITextField class], "_placeholderLabel");
 
     // Background color

+ 15 - 19
iOSClient/Main/CCDetail.m

@@ -59,17 +59,7 @@
 -  (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;
@@ -82,21 +72,23 @@
 - (void)viewDidLoad
 {
     [super viewDidLoad];
-    
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(insertGeocoderLocation:) name:@"insertGeocoderLocation" object:nil];
 
+    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];
+    
     // Change bar bottom line shadow and remove title back button <"title"
-    self.navigationController.navigationBar.shadowImage = [CCGraphics generateSinglePixelImageWithColor:NCBrandColor.sharedInstance.brand];
     self.navigationController.navigationBar.topItem.title = @"";
     
-    // Color Navigation Controller
-    [appDelegate aspectNavigationControllerBar:self.navigationController.navigationBar];
-
-    // TabBar
-    self.tabBarController.tabBar.hidden = YES;
-    self.tabBarController.tabBar.translucent = YES;
+    // changeTheming
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTheming) name:@"changeTheming" object:nil];
+    [self changeTheming];
     
     // Open View
     if ([self.metadataDetail.fileNameView length] > 0 || [self.metadataDetail.serverUrl length] > 0 || [self.metadataDetail.ocId length] > 0) {        
@@ -108,6 +100,7 @@
 {
     [super viewWillAppear:animated];
     
+     // TabBar
     self.tabBarController.tabBar.hidden = YES;
     self.tabBarController.tabBar.translucent = YES;
     self.view.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
@@ -147,6 +140,9 @@
         self.toolbar.tintColor = NCBrandColor.sharedInstance.brandElement;
     }
     
+    // TabBar
+    self.tabBarController.tabBar.hidden = YES;
+    self.tabBarController.tabBar.translucent = YES;
     self.view.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
 }
 

+ 7 - 23
iOSClient/Main/CCMain.m

@@ -88,15 +88,12 @@
     if (self = [super initWithCoder:aDecoder])  {
         
         appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+        appDelegate.activeMain = self;
         
         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(initializeMain:) name:@"initializeMain" object:nil];
         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(clearDateReadDataSource:) name:@"clearDateReadDataSource" object:nil];
         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setTitle) name:@"setTitleMain" object:nil];
         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(triggerProgressTask:) name:@"NotificationProgressTask" object:nil];
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTheming) name:@"changeTheming" object:nil];
-        
-        // Active Main
-        appDelegate.activeMain = self;
     }
     
     return self;
@@ -159,6 +156,10 @@
     
     // Title
     [self setTitle];
+
+    // changeTheming
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTheming) name:@"changeTheming" object:nil];
+    [self changeTheming];
 }
 
 - (void)viewWillAppear:(BOOL)animated
@@ -169,15 +170,6 @@
     if (appDelegate.activeAccount.length == 0)
         return;
     
-    // Color
-    [appDelegate aspectNavigationControllerBar:self.navigationController.navigationBar];
-    [appDelegate aspectTabBar:self.tabBarController.tabBar];
-    self.tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
-    self.tableView.separatorColor = NCBrandColor.sharedInstance.separator;
-
-    // Plus Button
-    [appDelegate plusButtonVisibile:true];
-
     if (_isSelectedMode)
         [self setUINavigationBarSelected];
     else
@@ -278,8 +270,7 @@
 
 - (void)changeTheming
 {
-    if (self.isViewLoaded && self.view.window)
-        [appDelegate changeTheming:self tableView:self.tableView collectionView:nil];
+    [appDelegate changeTheming:self tableView:self.tableView collectionView:nil];
     
     // Refresh control
     refreshControl.tintColor = NCBrandColor.sharedInstance.brandText;
@@ -539,9 +530,6 @@
 
 - (void)setTitle
 {
-    // Color text self.navigationItem.title
-    [appDelegate aspectNavigationControllerBar:self.navigationController.navigationBar];
-    
     if (_isSelectedMode) {
         
         NSUInteger totali = [sectionDataSource.allRecordsDataSource count];
@@ -620,8 +608,6 @@
 
 - (void)setUINavigationBarDefault
 {
-    [appDelegate aspectNavigationControllerBar:self.navigationController.navigationBar];
-    
     UIBarButtonItem *buttonMore, *buttonNotification;
     
     // =
@@ -648,9 +634,7 @@
 }
 
 - (void)setUINavigationBarSelected
-{
-    [appDelegate aspectNavigationControllerBar:self.navigationController.navigationBar];
-    
+{    
     UIImage *icon = [UIImage imageNamed:@"navigationControllerMenu"];
     UIBarButtonItem *buttonMore = [[UIBarButtonItem alloc] initWithImage:icon style:UIBarButtonItemStylePlain target:self action:@selector(toggleReSelectMenu)];
 

+ 7 - 30
iOSClient/Main/CCMore.swift

@@ -59,6 +59,7 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
         tableView.dataSource = self
         
         themingBackground.image = #imageLiteral(resourceName: "themingBackground")
+        self.navigationItem.title = NSLocalizedString("_more_", comment: "")
         
         // create tap gesture recognizer
         let tapQuota = UITapGestureRecognizer(target: self, action: #selector(tapLabelQuotaExternalSite))
@@ -72,6 +73,9 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
         // Notification
         NotificationCenter.default.addObserver(self, selector: #selector(self.changeTheming), name: NSNotification.Name(rawValue: "changeTheming"), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(self.changeUserProfile), name: NSNotification.Name(rawValue: "changeUserProfile"), object: nil)
+        
+        // Theming view
+        changeTheming()
     }
     
     override func viewWillAppear(_ animated: Bool) {
@@ -178,37 +182,15 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
             labelQuotaExternalSite.text = item.name
         }
         
-        // User data & Theming
         changeUserProfile()
-        changeTheming()
-        tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
-        viewQuota.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
-        tableView.separatorColor = NCBrandColor.sharedInstance.separator
-
-        // Title
-        self.navigationItem.title = NSLocalizedString("_more_", comment: "")
-        
-        // Aspect
-        appDelegate.aspectNavigationControllerBar(self.navigationController?.navigationBar)
-        appDelegate.aspectTabBar(self.tabBarController?.tabBar)
-
-        // +
-        appDelegate.plusButtonVisibile(true)
-        
-        self.navigationController?.setNavigationBarHidden(true, animated: animated)
-        
         tableView.reloadData()
     }
     
-    override func viewWillDisappear(_ animated: Bool) {
-        super.viewWillDisappear(animated)
-        
-        self.navigationController?.setNavigationBarHidden(false, animated: animated)
-    }
-    
     @objc func changeTheming() {
         
         self.view.backgroundColor = NCBrandColor.sharedInstance.brand
+        viewQuota.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
+        progressQuota.progressTintColor = NCBrandColor.sharedInstance.brandElement
         
         let fileNamePath = CCUtility.getDirectoryUserData() + "/" + CCUtility.getStringUser(appDelegate.activeUser, activeUrl: appDelegate.activeUrl) + "-themingBackground.png"
         
@@ -222,10 +204,7 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
         
         disclosureIndicator.image = CCGraphics.changeThemingColorImage(disclosureIndicator.image, width: 48, height: 52, color: NCBrandColor.sharedInstance.brandText)
         
-        if (self.isViewLoaded && (self.view.window != nil)) {
-            appDelegate.changeTheming(self, tableView: tableView, collectionView: nil)
-            viewQuota.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
-        }
+        appDelegate.changeTheming(self, tableView: tableView, collectionView: nil)
     }
     
     @objc func changeUserProfile() {
@@ -266,8 +245,6 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
             progressQuota.progress = 0
         }
 
-        progressQuota.progressTintColor = NCBrandColor.sharedInstance.brandElement
-        
         switch Double(tabAccount.quotaTotal) {
         case Double(k_quota_space_not_computed):
             quota = "0"

+ 4 - 5
iOSClient/Main/CCSplit.m

@@ -43,8 +43,6 @@
 -  (id)initWithCoder:(NSCoder *)aDecoder
 {
     if (self = [super initWithCoder:aDecoder])  {
-        
-        appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
         prevRunningInFullScreen = YES;
     }
     
@@ -55,6 +53,7 @@
 {
     [super viewDidLoad];
 
+    appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
     self.delegate = self;
     
     // Display mode SPLIT
@@ -66,8 +65,8 @@
     [appDelegate createTabBarController:tabBarController];
     
     // Settings Navigation Controller
-    UINavigationController *navigationController = [self.viewControllers lastObject];
-    [appDelegate aspectNavigationControllerBar:navigationController.navigationBar];
+//    UINavigationController *navigationController = [self.viewControllers lastObject];
+//    [appDelegate aspectNavigationControllerBar:navigationController.navigationBar];
     
     [self inizialize];    
 }
@@ -196,7 +195,7 @@
     UINavigationController *secondaryNC = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"CCDetailNC"];
     
     // Color
-    [appDelegate aspectNavigationControllerBar:secondaryNC.navigationBar];
+//    [appDelegate aspectNavigationControllerBar:secondaryNC.navigationBar];
     
     // Ensure back button is enabled
     UIViewController *detailViewController = [secondaryNC visibleViewController];

+ 5 - 12
iOSClient/Media/NCMedia.swift

@@ -94,23 +94,19 @@ class NCMedia: UIViewController, DropdownMenuDelegate, DZNEmptyDataSetSource, DZ
         collectionView.emptyDataSetDelegate = self
         collectionView.emptyDataSetSource = self
         
-        // Notification
-        NotificationCenter.default.addObserver(self, selector: #selector(self.changeTheming), name: NSNotification.Name(rawValue: "changeTheming"), object: nil)
-        
         // 3D Touch peek and pop
         if traitCollection.forceTouchCapability == .available {
             registerForPreviewing(with: self, sourceView: view)
         }
+        
+        // changeTheming
+        NotificationCenter.default.addObserver(self, selector: #selector(self.changeTheming), name: NSNotification.Name(rawValue: "changeTheming"), object: nil)
+        changeTheming()
     }
     
     override func viewWillAppear(_ animated: Bool) {
         super.viewWillAppear(animated)
         
-        // Aspect Color
-        appDelegate.aspectNavigationControllerBar(self.navigationController?.navigationBar)
-        appDelegate.aspectTabBar(self.tabBarController?.tabBar)
-        collectionView.backgroundColor = NCBrandColor.sharedInstance.backgroundView
-        
         // Configure Refresh Control
         refreshControl.tintColor = NCBrandColor.sharedInstance.brandText
         refreshControl.backgroundColor = NCBrandColor.sharedInstance.brand
@@ -156,10 +152,7 @@ class NCMedia: UIViewController, DropdownMenuDelegate, DZNEmptyDataSetSource, DZ
     }
     
     @objc func changeTheming() {
-        
-        if self.isViewLoaded && self.view?.window != nil {
-            appDelegate.changeTheming(self, tableView: nil, collectionView: collectionView)
-        }
+        appDelegate.changeTheming(self, tableView: nil, collectionView: collectionView)
     }
 
     // MARK: DZNEmpty

+ 9 - 6
iOSClient/Offline/NCOffline.swift

@@ -108,16 +108,15 @@ class NCOffline: UIViewController, UIGestureRecognizerDelegate, NCListCellDelega
         if traitCollection.forceTouchCapability == .available {
             registerForPreviewing(with: self, sourceView: view)
         }
+        
+        // changeTheming
+        NotificationCenter.default.addObserver(self, selector: #selector(self.changeTheming), name: NSNotification.Name(rawValue: "changeTheming"), object: nil)
+        changeTheming()
     }
     
     override func viewWillAppear(_ animated: Bool) {
         super.viewWillAppear(animated)
-        
-        // Color
-        appDelegate.aspectNavigationControllerBar(self.navigationController?.navigationBar)
-        appDelegate.aspectTabBar(self.tabBarController?.tabBar)
-        collectionView.backgroundColor = NCBrandColor.sharedInstance.backgroundView
-        
+
         self.navigationItem.title = titleCurrentFolder
         
         (typeLayout, datasourceSorted, datasourceAscending, datasourceGroupBy, datasourceDirectoryOnTop) = NCUtility.sharedInstance.getLayoutForView(key: k_layout_view_offline)
@@ -144,6 +143,10 @@ class NCOffline: UIViewController, UIGestureRecognizerDelegate, NCListCellDelega
         }
     }
     
+    @objc func changeTheming() {
+        appDelegate.changeTheming(self, tableView: nil, collectionView: collectionView)
+    }
+    
     // MARK: DZNEmpty
     
     func backgroundColor(forEmptyDataSet scrollView: UIScrollView) -> UIColor? {

+ 9 - 3
iOSClient/ScanDocument/ScanCollectionView.swift

@@ -88,13 +88,15 @@ class DragDropViewController: UIViewController {
         
         let longPressRecognizer = UILongPressGestureRecognizer(target: self, action: #selector(handleLongPressGesture(recognizer:)))
         add.addGestureRecognizer(longPressRecognizer)
+        
+        // changeTheming
+        NotificationCenter.default.addObserver(self, selector: #selector(self.changeTheming), name: NSNotification.Name(rawValue: "changeTheming"), object: nil)
+        changeTheming()
     }
     
     override func viewWillAppear(_ animated: Bool) {
         super.viewWillAppear(animated)
-        
-        appDelegate.aspectNavigationControllerBar(self.navigationController?.navigationBar)
-        
+                
         labelTitlePDFzone.textColor = NCBrandColor.sharedInstance.brandText
         labelTitlePDFzone.backgroundColor = NCBrandColor.sharedInstance.brand
         
@@ -110,6 +112,10 @@ class DragDropViewController: UIViewController {
         loadImage(atPath: CCUtility.getDirectoryScan(), items: &itemsSource)
     }
     
+    @objc func changeTheming() {
+        appDelegate.changeTheming(self, tableView: nil, collectionView: nil)
+    }
+    
     //MARK: Button Action
 
     @IBAction func cancelAction(sender: UIBarButtonItem) {

+ 8 - 5
iOSClient/Select/NCSelect.swift

@@ -129,16 +129,15 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, NCListCellDelegat
         // title button
         buttonCancel.title = NSLocalizedString("_cancel_", comment: "")
         buttonCreateFolder.title = NSLocalizedString("_create_folder_", comment: "")
+        
+        // changeTheming
+        NotificationCenter.default.addObserver(self, selector: #selector(self.changeTheming), name: NSNotification.Name(rawValue: "changeTheming"), object: nil)
+        changeTheming()
     }
     
     override func viewWillAppear(_ animated: Bool) {
         super.viewWillAppear(animated)
         
-        // Color
-        appDelegate.aspectNavigationControllerBar(self.navigationController?.navigationBar)
-        toolbar.barTintColor = NCBrandColor.sharedInstance.tabBar
-        toolbar.tintColor = NCBrandColor.sharedInstance.textView
-        
         self.navigationItem.title = titleCurrentFolder
         
         buttonDone.title = titleButtonDone
@@ -179,6 +178,10 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, NCListCellDelegat
         }
     }
     
+    @objc func changeTheming() {
+        appDelegate.changeTheming(self, tableView: nil, collectionView: collectionView)
+    }
+    
     // MARK: DZNEmpty
     
     func backgroundColor(forEmptyDataSet scrollView: UIScrollView) -> UIColor? {

+ 9 - 6
iOSClient/Settings/Acknowledgements.m

@@ -38,9 +38,6 @@
     
     appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
 
-    [appDelegate aspectNavigationControllerBar:self.navigationController.navigationBar];
-    self.navigationController.navigationBar.translucent = false;
-    
     NSURL *rtfPath;
     
     //NSString * language = [[NSLocale preferredLanguages] objectAtIndex:0];
@@ -57,19 +54,25 @@
     self.title = NSLocalizedString(@"_acknowledgements_", nil);
     self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(cancelPressed)];
     self.txtTermini.hidden = true;
+    
+    // changeTheming
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTheming) name:@"changeTheming" object:nil];
+    [self changeTheming];
 }
 
 - (void)viewDidAppear:(BOOL)animated
 {
     [super viewDidAppear:animated];
     
-    // Color
-    [appDelegate aspectNavigationControllerBar:self.navigationController.navigationBar];
-    
     [self.txtTermini setContentOffset:CGPointZero animated:NO];
     self.txtTermini.hidden = false;
 }
 
+- (void)changeTheming
+{
+    [appDelegate changeTheming:self tableView:nil collectionView:nil];
+}
+
 - (void)cancelPressed
 {
     [self dismissViewControllerAnimated:true completion:nil];

+ 3 - 12
iOSClient/Settings/CCAdvanced.m

@@ -147,6 +147,7 @@
     row.action.formSelector = @selector(exitNextcloud:);
     [section addFormRow:row];
 
+    self.tableView.showsVerticalScrollIndicator = NO;
     self.form = form;
 }
 
@@ -155,22 +156,12 @@
     [super viewDidLoad];
     
     appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+    
+    // changeTheming
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTheming) name:@"changeTheming" object:nil];
     [self initializeForm];
 }
 
-- (void)viewWillAppear:(BOOL)animated
-{
-    [super viewWillAppear:animated];
-    
-    self.tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
-    self.tableView.showsVerticalScrollIndicator = NO;
-    self.tableView.separatorColor = NCBrandColor.sharedInstance.separator;
-
-    [appDelegate aspectNavigationControllerBar:self.navigationController.navigationBar];
-    [appDelegate aspectTabBar:self.tabBarController.tabBar];
-}
-
 - (void)changeTheming
 {
     [appDelegate changeTheming:self tableView:self.tableView collectionView:nil];

+ 3 - 12
iOSClient/Settings/CCManageAccount.m

@@ -320,6 +320,7 @@
         [section addFormRow:row];
     }
     
+    self.tableView.showsVerticalScrollIndicator = NO;
     self.form = form;
     
     // Open Login
@@ -333,22 +334,12 @@
     [super viewDidLoad];
     
     appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+    
+    // changeTheming
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTheming) name:@"changeTheming" object:nil];
     [self initializeForm];
 }
 
-- (void)viewWillAppear:(BOOL)animated
-{
-    [super viewWillAppear:animated];
-    
-    self.tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
-    self.tableView.showsVerticalScrollIndicator = NO;
-    self.tableView.separatorColor = NCBrandColor.sharedInstance.separator;
-
-    [appDelegate aspectNavigationControllerBar:self.navigationController.navigationBar];
-    [appDelegate aspectTabBar:self.tabBarController.tabBar];    
-}
-
 - (void)changeTheming
 {
     [appDelegate changeTheming:self tableView:self.tableView collectionView:nil];

+ 4 - 8
iOSClient/Settings/CCManageAutoUpload.m

@@ -178,6 +178,8 @@
     
     section = [XLFormSectionDescriptor formSection];
     [form addFormSection:section];
+    
+    self.tableView.showsVerticalScrollIndicator = NO;
     self.form = form;
 }
 
@@ -186,6 +188,8 @@
     [super viewDidLoad];
     
     appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+    
+    // changeTheming
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTheming) name:@"changeTheming" object:nil];
     [self initializeForm];
 }
@@ -194,14 +198,6 @@
 {
     [super viewWillAppear:animated];
     
-    self.tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
-    self.tableView.showsVerticalScrollIndicator = NO;
-    self.tableView.separatorColor = NCBrandColor.sharedInstance.separator;
-
-    // Color
-    [appDelegate aspectNavigationControllerBar:self.navigationController.navigationBar];
-    [appDelegate aspectTabBar:self.tabBarController.tabBar];
-    
     // Request permission for camera roll access
     [PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
         switch (status) {

+ 5 - 17
iOSClient/Settings/CCSettings.m

@@ -189,6 +189,7 @@
     [section addFormRow:row];
     */
     
+    self.tableView.showsVerticalScrollIndicator = NO;
     self.form = form;
 }
 
@@ -197,21 +198,14 @@
     [super viewDidLoad];
     
     appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+    
+    // changeTheming
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTheming) name:@"changeTheming" object:nil];
     [self initializeForm];
 }
 
 - (void)viewWillAppear:(BOOL)animated
 {
-    [super viewWillAppear:animated];
-    
-    self.tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
-    self.tableView.showsVerticalScrollIndicator = NO;
-    self.tableView.separatorColor = NCBrandColor.sharedInstance.separator;
-
-    [appDelegate aspectNavigationControllerBar:self.navigationController.navigationBar];
-    [appDelegate aspectTabBar:self.tabBarController.tabBar];
-
     [self reloadForm];
 }
 
@@ -319,10 +313,7 @@
         }
         
         [appDelegate settingDarkMode];
-        
-        [appDelegate aspectNavigationControllerBar:self.navigationController.navigationBar];
-        [appDelegate aspectTabBar:self.tabBarController.tabBar];
-        self.tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
+        [self changeTheming];
         [self initializeForm];
         [self reloadForm];
     }
@@ -348,10 +339,7 @@
             [CCUtility setDarkModeDetect:false];
             
             [appDelegate settingDarkMode];
-            
-            [appDelegate aspectNavigationControllerBar:self.navigationController.navigationBar];
-            [appDelegate aspectTabBar:self.tabBarController.tabBar];
-            self.tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
+            [self changeTheming];
             [self initializeForm];
             [self reloadForm];
         }

+ 7 - 14
iOSClient/Settings/NCManageEndToEndEncryption.m

@@ -61,6 +61,7 @@
         [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
         [section addFormRow:row];
         
+        self.tableView.showsVerticalScrollIndicator = NO;
         self.form = form;
 
         return;
@@ -154,31 +155,23 @@
     [section addFormRow:row];
 #endif
     
+    self.tableView.showsVerticalScrollIndicator = NO;
     self.form = form;
 }
 
 - (void)viewDidLoad
 {
     [super viewDidLoad];
-    appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTheming) name:@"changeTheming" object:nil];
-    [self initializeForm];
     
+    appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+        
     // E2EE
     self.endToEndInitialize = [NCEndToEndInitialize new];
     self.endToEndInitialize.delegate = self;
-}
-
-- (void)viewWillAppear:(BOOL)animated
-{
-    [super viewWillAppear:animated];
     
-    self.tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
-    self.tableView.showsVerticalScrollIndicator = NO;
-    self.tableView.separatorColor = NCBrandColor.sharedInstance.separator;
-    
-    [appDelegate aspectNavigationControllerBar:self.navigationController.navigationBar];
-    [appDelegate aspectTabBar:self.tabBarController.tabBar];
+    // changeTheming
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTheming) name:@"changeTheming" object:nil];
+    [self changeTheming];
 }
 
 - (void)changeTheming

+ 9 - 26
iOSClient/Shares/NCShares.m

@@ -39,22 +39,12 @@
 #pragma mark ===== Init =====
 #pragma --------------------------------------------------------------------------------------------
 
-- (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];
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadDatasource) name:@"SharesReloadDatasource" object:nil];
-    }
-    return self;
-}
-
 - (void)viewDidLoad
 {
     [super viewDidLoad];
     
+    appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+
     // Custom Cell
     [self.tableView registerNib:[UINib nibWithNibName:@"NCSharesCell" bundle:nil] forCellReuseIdentifier:@"Cell"];
 
@@ -73,6 +63,12 @@
     if ([self.traitCollection respondsToSelector:@selector(forceTouchCapability)] && (self.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable)) {
         [self registerForPreviewingWithDelegate:self sourceView:self.view];
     }
+    
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadDatasource) name:@"SharesReloadDatasource" object:nil];
+    
+    // changeTheming
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTheming) name:@"changeTheming" object:nil];
+    [self changeTheming];
 }
 
 // Apparirà
@@ -80,25 +76,12 @@
 {
     [super viewWillAppear:animated];
     
-    // Color
-    [appDelegate aspectNavigationControllerBar:self.navigationController.navigationBar];
-    [appDelegate aspectTabBar:self.tabBarController.tabBar];
-    self.tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
-    self.tableView.separatorColor = NCBrandColor.sharedInstance.separator;
-
-    // Plus Button
-    [appDelegate plusButtonVisibile:true];
-    
     [self reloadDatasource];
 }
 
 - (void)changeTheming
 {
-    if (self.isViewLoaded && self.view.window)
-        [appDelegate changeTheming:self tableView:self.tableView collectionView:nil];
-    
-    // Reload Table View
-    [self.tableView reloadData];
+    [appDelegate changeTheming:self tableView:self.tableView collectionView:nil];
 }
 
 #pragma --------------------------------------------------------------------------------------------

+ 7 - 15
iOSClient/Transfers/CCTransfers.m

@@ -53,12 +53,7 @@
 -  (id)initWithCoder:(NSCoder *)aDecoder
 {
     if (self = [super initWithCoder:aDecoder])  {
-        
         appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
-
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(triggerProgressTask:) name:@"NotificationProgressTask" object:nil];
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTheming) name:@"changeTheming" object:nil];
-        
         appDelegate.activeTransfers = self;
     }
     return self;
@@ -68,6 +63,8 @@
     
     [super viewDidLoad];
     
+    self.title = NSLocalizedString(@"_transfers_", nil);
+
     // Custom Cell
     [self.tableView registerNib:[UINib nibWithNibName:@"CCCellMain" bundle:nil] forCellReuseIdentifier:@"CellMain"];
     [self.tableView registerNib:[UINib nibWithNibName:@"CCCellMainTransfer" bundle:nil] forCellReuseIdentifier:@"CellMainTransfer"];
@@ -84,7 +81,9 @@
     UILongPressGestureRecognizer* longPressRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(onLongPressTableView:)];
     [self.tableView addGestureRecognizer:longPressRecognizer];
     
-    self.title = NSLocalizedString(@"_transfers_", nil);
+    // changeTheming
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(triggerProgressTask:) name:@"NotificationProgressTask" object:nil];
+    [self changeTheming];
     
     [self reloadDatasource:nil action:k_action_NULL];
 }
@@ -93,19 +92,12 @@
 {
     [super viewDidAppear:animated];
         
-    // Color
-    [appDelegate aspectNavigationControllerBar:self.navigationController.navigationBar];
-    [appDelegate aspectTabBar:self.tabBarController.tabBar];
-    
-    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.001 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) {
-        [self reloadDatasource:nil action:k_action_NULL];
-    });
+    [self reloadDatasource:nil action:k_action_NULL];
 }
 
 - (void)changeTheming
 {
-    if (self.isViewLoaded && self.view.window)
-        [appDelegate changeTheming:self tableView:self.tableView collectionView:nil];
+    [appDelegate changeTheming:self tableView:self.tableView collectionView:nil];
 }
 
 #pragma --------------------------------------------------------------------------------------------

+ 9 - 6
iOSClient/Trash/NCTrash.swift

@@ -80,17 +80,16 @@ class NCTrash: UIViewController, UIGestureRecognizerDelegate, NCTrashListCellDel
         
         // empty Data Source
         self.collectionView.emptyDataSetDelegate = self;
-        self.collectionView.emptyDataSetSource = self;        
+        self.collectionView.emptyDataSetSource = self;
+        
+        // changeTheming
+        NotificationCenter.default.addObserver(self, selector: #selector(self.changeTheming), name: NSNotification.Name(rawValue: "changeTheming"), object: nil)
+        changeTheming()
     }
     
     override func viewWillAppear(_ animated: Bool) {
         super.viewWillAppear(animated)
         
-        // Color
-        appDelegate.aspectNavigationControllerBar(self.navigationController?.navigationBar)
-        appDelegate.aspectTabBar(self.tabBarController?.tabBar)
-        collectionView.backgroundColor = NCBrandColor.sharedInstance.backgroundView
-        
         self.navigationItem.title = titleCurrentFolder
 
         (typeLayout, datasourceSorted, datasourceAscending, datasourceGroupBy, datasourceDirectoryOnTop) = NCUtility.sharedInstance.getLayoutForView(key: k_layout_view_trash)
@@ -124,6 +123,10 @@ class NCTrash: UIViewController, UIGestureRecognizerDelegate, NCTrashListCellDel
         }
     }
     
+    @objc func changeTheming() {
+        appDelegate.changeTheming(self, tableView: nil, collectionView: collectionView)
+    }
+    
     // MARK: DZNEmpty
     
     func backgroundColor(forEmptyDataSet scrollView: UIScrollView) -> UIColor? {

+ 7 - 13
iOSClient/UploadFromOtherUpp/CCUploadFromOtherUpp.m

@@ -48,22 +48,16 @@
     serverUrlLocal= [CCUtility getHomeServerUrlActiveUrl:appDelegate.activeUrl];
     destinationTitle = NSLocalizedString(@"_home_", nil);
     
-    // Color
-    [appDelegate aspectNavigationControllerBar:self.navigationController.navigationBar];
-    [appDelegate aspectTabBar:self.tabBarController.tabBar];
-}
-
-- (void)didReceiveMemoryWarning
-{
-    [super didReceiveMemoryWarning];
+    // changeTheming
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTheming) name:@"changeTheming" object:nil];
+    [self changeTheming];
+    
+    [self.tableView reloadData];
 }
 
-// E' apparsa
-- (void)viewDidAppear:(BOOL)animated
+- (void)changeTheming
 {
-    [super viewDidAppear:animated];
-    
-    [self.tableView reloadData];
+    [appDelegate changeTheming:self tableView:self.tableView collectionView:nil];
 }
 
 #pragma --------------------------------------------------------------------------------------------