marinofaggiana 4 years ago
parent
commit
c5eb3cae69

+ 6 - 2
iOSClient/Activity/NCActivity.swift

@@ -80,9 +80,13 @@ class NCActivity: UIViewController, DZNEmptyDataSetSource, DZNEmptyDataSetDelega
     @objc func changeTheming() {
         
         if filterFileId == nil {
-            appDelegate.changeTheming(self, tableView: tableView, collectionView: nil, form: false)
+            view.backgroundColor = NCBrandColor.sharedInstance.backgroundView
+            tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundView
+            tableView.reloadData()
         } else {
-            appDelegate.changeTheming(self, tableView: tableView, collectionView: nil, form: true)
+            view.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
+            tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
+            tableView.reloadData()
         }
     }
     

+ 0 - 1
iOSClient/AppDelegate.h

@@ -147,7 +147,6 @@
 
 // Theming Color
 - (void)settingThemingColorBrand;
-- (void)changeTheming:(UIViewController *)viewController tableView:(UITableView *)tableView collectionView:(UICollectionView *)collectionView form:(BOOL)form;
 
 // Maintenance Mode
 - (void)maintenanceMode:(BOOL)mode;

+ 0 - 25
iOSClient/AppDelegate.m

@@ -874,31 +874,6 @@
     });
 }
 
-- (void)changeTheming:(UIViewController *)viewController tableView:(UITableView *)tableView collectionView:(UICollectionView *)collectionView form:(BOOL)form
-{
-    [NCBrandColor.sharedInstance setDarkMode];
-    [self.window setTintColor:NCBrandColor.sharedInstance.textView];
-
-    // View
-    if (form) viewController.view.backgroundColor = NCBrandColor.sharedInstance.backgroundForm;
-    else viewController.view.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
-            
-    // TableView
-    if (tableView) {
-        if (form) tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundForm;
-        else tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
-        tableView.separatorColor = NCBrandColor.sharedInstance.separator;
-        [tableView reloadData];
-    }
-    
-    // CollectionView
-    if (collectionView) {
-        if (form) collectionView.backgroundColor = NCBrandColor.sharedInstance.backgroundForm;
-        else collectionView.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
-        [collectionView reloadData];
-    }
-}
-
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ===== Fetch =====
 #pragma --------------------------------------------------------------------------------------------

+ 4 - 4
iOSClient/Detail/NCDetailViewController.swift

@@ -167,11 +167,11 @@ class NCDetailViewController: UIViewController {
     //MARK: - NotificationCenter
 
     @objc func changeTheming() {
-        appDelegate.changeTheming(self, tableView: nil, collectionView: nil, form: false)
+        //appDelegate.changeTheming(self, tableView: nil, collectionView: nil, form: false)
         
-        if navigationController?.isNavigationBarHidden == false {
-            view.backgroundColor = NCBrandColor.sharedInstance.backgroundView
-        }
+//        if navigationController?.isNavigationBarHidden == false {
+//            view.backgroundColor = NCBrandColor.sharedInstance.backgroundView
+//        }
     }
    
     /*

+ 5 - 2
iOSClient/Main/CCMore.swift

@@ -183,8 +183,11 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
     }
 
     @objc func changeTheming() {
-        appDelegate.changeTheming(self, tableView: tableView, collectionView: nil, form: true)
-
+        view.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
+        tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
+        tableView.separatorColor = NCBrandColor.sharedInstance.separator
+        tableView.reloadData()
+        
         viewQuota.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
         progressQuota.progressTintColor = NCBrandColor.sharedInstance.brandElement
     }

+ 3 - 1
iOSClient/Main/Colleaction Common/NCCollectionViewCommon.swift

@@ -254,7 +254,9 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
     }
     
     @objc func changeTheming() {
-        appDelegate.changeTheming(self, tableView: nil, collectionView: collectionView, form: false)
+        view.backgroundColor = NCBrandColor.sharedInstance.backgroundView
+        collectionView.backgroundColor = NCBrandColor.sharedInstance.backgroundView
+        collectionView.reloadData()
     }
     
     @objc func reloadDataSource(_ notification: NSNotification) {

+ 3 - 1
iOSClient/Main/Create cloud/NCCreateFormUploadAssets.swift

@@ -99,7 +99,9 @@ class NCCreateFormUploadAssets: XLFormViewController, NCSelectDelegate {
     }
     
     @objc func changeTheming() {
-        appDelegate.changeTheming(self, tableView: tableView, collectionView: nil, form: true)
+        view.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
+        tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
+        tableView.reloadData()
         initializeForm()
         self.reloadForm()
     }

+ 3 - 1
iOSClient/Main/Create cloud/NCCreateFormUploadDocuments.swift

@@ -83,7 +83,9 @@ import NCCommunication
     }
     
     @objc func changeTheming() {
-        appDelegate.changeTheming(self, tableView: tableView, collectionView: collectionView, form: false)
+        view.backgroundColor = NCBrandColor.sharedInstance.backgroundView
+        collectionView.backgroundColor = NCBrandColor.sharedInstance.backgroundView
+        collectionView.reloadData()
         initializeForm()
     }
     

+ 3 - 1
iOSClient/Main/Create cloud/NCCreateFormUploadScanDocument.swift

@@ -92,7 +92,9 @@ class NCCreateFormUploadScanDocument: XLFormViewController, NCSelectDelegate, NC
     }
     
     @objc func changeTheming() {
-        appDelegate.changeTheming(self, tableView: tableView, collectionView: nil, form: true)
+        view.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
+        tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
+        tableView.reloadData()
         initializeForm()
     }
     

+ 4 - 2
iOSClient/Main/Create cloud/NCCreateFormUploadVoiceNote.swift

@@ -99,8 +99,10 @@ class NCCreateFormUploadVoiceNote: XLFormViewController, NCSelectDelegate, AVAud
     }
     
     @objc func changeTheming() {
-        appDelegate.changeTheming(self, tableView: tableView, collectionView: nil, form: true)
-        
+        view.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
+        tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
+        tableView.reloadData()
+                
         labelTimer.textColor = NCBrandColor.sharedInstance.textView
         labelDuration.textColor = NCBrandColor.sharedInstance.textView
         

+ 3 - 1
iOSClient/Media/NCMedia.swift

@@ -385,7 +385,9 @@ class NCMedia: UIViewController, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate,
     //MARK: - NotificationCenter
 
     @objc func changeTheming() {
-        appDelegate.changeTheming(self, tableView: nil, collectionView: collectionView, form: false)
+        view.backgroundColor = NCBrandColor.sharedInstance.backgroundView
+        collectionView.backgroundColor = NCBrandColor.sharedInstance.backgroundView
+        collectionView.reloadData()
         
         cacheImages.cellLivePhotoImage = CCGraphics.changeThemingColorImage(UIImage.init(named: "livePhoto"), width: 100, height: 100, color: .white)
         cacheImages.cellPlayImage = CCGraphics.changeThemingColorImage(UIImage.init(named: "play"), width: 100, height: 100, color: .white)

+ 3 - 1
iOSClient/Notification/NCNotification.swift

@@ -59,7 +59,9 @@ class NCNotification: UITableViewController, NCNotificationCellDelegate, DZNEmpt
     }
     
     @objc func changeTheming() {
-        appDelegate.changeTheming(self, tableView: tableView, collectionView: nil, form: false)
+        view.backgroundColor = NCBrandColor.sharedInstance.backgroundView
+        tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundView
+        tableView.reloadData()        
     }
 
     @objc func viewClose() {

+ 1 - 2
iOSClient/RichWorkspace/NCViewerRichWorkspace.swift

@@ -80,8 +80,7 @@ import MarkdownKit
     }
     
     @objc func changeTheming() {
-        
-        appDelegate.changeTheming(self, tableView: nil, collectionView: nil, form: false)
+        view.backgroundColor = NCBrandColor.sharedInstance.backgroundView
         if textViewColor != NCBrandColor.sharedInstance.textView {
             markdownParser = MarkdownParser(font: UIFont.systemFont(ofSize: 15), color: NCBrandColor.sharedInstance.textView)
             markdownParser.header.font = UIFont.systemFont(ofSize: 25)

+ 5 - 3
iOSClient/ScanDocument/ScanCollectionView.swift

@@ -91,11 +91,13 @@ class DragDropViewController: UIViewController {
     }
     
     @objc func changeTheming() {
-        appDelegate.changeTheming(self, tableView: nil, collectionView: nil, form: true)
-        
+        view.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
+
         collectionViewSource.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
         collectionViewDestination.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
-        
+        collectionViewSource.reloadData()
+        collectionViewDestination.reloadData()
+
         labelTitlePDFzone.textColor = NCBrandColor.sharedInstance.textView
         if #available(iOS 13.0, *) {
             labelTitlePDFzone.backgroundColor = .systemBackground

+ 3 - 1
iOSClient/Select/NCSelect.swift

@@ -208,7 +208,9 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, NCListCellDelegat
     }
     
     @objc func changeTheming() {
-        appDelegate.changeTheming(self, tableView: nil, collectionView: collectionView, form: false)
+        view.backgroundColor = NCBrandColor.sharedInstance.backgroundView
+        collectionView.backgroundColor = NCBrandColor.sharedInstance.backgroundView
+        collectionView.reloadData()
         refreshControl.backgroundColor = NCBrandColor.sharedInstance.backgroundView
         toolbar.backgroundColor = NCBrandColor.sharedInstance.tabBar
         //toolbar.tintColor = .gray

+ 1 - 1
iOSClient/Settings/Acknowledgements.m

@@ -63,7 +63,7 @@
 
 - (void)changeTheming
 {
-    [appDelegate changeTheming:self tableView:nil collectionView:nil form:false];
+    
 }
 
 - (void)cancelPressed

+ 3 - 1
iOSClient/Settings/CCAdvanced.m

@@ -254,7 +254,9 @@
 
 - (void)changeTheming
 {
-    [appDelegate changeTheming:self tableView:self.tableView collectionView:nil form:true];
+    self.view.backgroundColor = NCBrandColor.sharedInstance.backgroundForm;
+    self.tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundForm;
+    [self.tableView reloadData];
     [self initializeForm];
 }
 

+ 3 - 1
iOSClient/Settings/CCManageAccount.m

@@ -329,7 +329,9 @@
 
 - (void)changeTheming
 {
-    [appDelegate changeTheming:self tableView:self.tableView collectionView:nil form:true];
+    self.view.backgroundColor = NCBrandColor.sharedInstance.backgroundForm;
+    self.tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundForm;
+    [self.tableView reloadData];
     [self initializeForm];
 }
 

+ 3 - 1
iOSClient/Settings/CCManageAutoUpload.m

@@ -231,7 +231,9 @@
 
 - (void)changeTheming
 {
-    [appDelegate changeTheming:self tableView:self.tableView collectionView:nil form:true];
+    self.view.backgroundColor = NCBrandColor.sharedInstance.backgroundForm;
+    self.tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundForm;
+    [self.tableView reloadData];
     [self initializeForm];
     [self reloadForm];
 }

+ 3 - 1
iOSClient/Settings/CCSettings.m

@@ -202,7 +202,9 @@
 
 - (void)changeTheming
 {
-    [appDelegate changeTheming:self tableView:self.tableView collectionView:nil form:true];
+    self.view.backgroundColor = NCBrandColor.sharedInstance.backgroundForm;
+    self.tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundForm;
+    [self.tableView reloadData];    
     [self initializeForm];
     [self reloadForm];
 }

+ 3 - 1
iOSClient/Settings/NCManageAutoUploadFileName.swift

@@ -54,7 +54,9 @@ class NCManageAutoUploadFileName: XLFormViewController {
     }
     
     @objc func changeTheming() {
-        appDelegate.changeTheming(self, tableView: tableView, collectionView: nil, form: true)
+        view.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
+        tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
+        tableView.reloadData()
         initializeForm()
         self.reloadForm()
     }

+ 3 - 1
iOSClient/Settings/NCManageEndToEndEncryption.m

@@ -186,7 +186,9 @@
 
 - (void)changeTheming
 {
-    [appDelegate changeTheming:self tableView:self.tableView collectionView:nil form:true];
+    self.view.backgroundColor = NCBrandColor.sharedInstance.backgroundForm;
+    self.tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundForm;
+    [self.tableView reloadData];    
     [self initializeForm];
 }
 

+ 3 - 2
iOSClient/Share/NCShare.swift

@@ -112,8 +112,9 @@ class NCShare: UIViewController, UIGestureRecognizerDelegate, NCShareLinkCellDel
     }
     
     @objc func changeTheming() {
-        appDelegate.changeTheming(self, tableView: tableView, collectionView: nil, form: true)
-        
+        view.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
+        tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
+        tableView.reloadData()
         shareLinkLabel.textColor = NCBrandColor.sharedInstance.textView
     }
         

+ 3 - 2
iOSClient/Share/NCShareComments.swift

@@ -95,8 +95,9 @@ class NCShareComments: UIViewController, NCShareCommentsCellDelegate {
     }
     
     @objc func changeTheming() {
-        appDelegate.changeTheming(self, tableView: tableView, collectionView: nil, form: true)
-        
+        view.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
+        tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
+        tableView.reloadData()
         labelUser.textColor = NCBrandColor.sharedInstance.textView
     }
     

+ 0 - 1
iOSClient/Share/NCSharePaging.swift

@@ -101,7 +101,6 @@ class NCSharePaging: UIViewController {
     //MARK: - NotificationCenter
     
     @objc func changeTheming() {
-        appDelegate.changeTheming(self, tableView: nil, collectionView: nil, form: true)
         view.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
         
         pagingViewController.backgroundColor = NCBrandColor.sharedInstance.backgroundForm

+ 3 - 1
iOSClient/Shares/NCShares.m

@@ -80,7 +80,9 @@
 
 - (void)changeTheming
 {
-    [appDelegate changeTheming:self tableView:self.tableView collectionView:nil form:false];
+    self.view.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
+    self.tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
+    [self.tableView reloadData];
 }
 
 #pragma --------------------------------------------------------------------------------------------

+ 3 - 1
iOSClient/Trash/NCTrash.swift

@@ -128,7 +128,9 @@ class NCTrash: UIViewController, UIGestureRecognizerDelegate, NCTrashListCellDel
     }
     
     @objc func changeTheming() {
-        appDelegate.changeTheming(self, tableView: nil, collectionView: collectionView, form: false)
+        view.backgroundColor = NCBrandColor.sharedInstance.backgroundView
+        collectionView.backgroundColor = NCBrandColor.sharedInstance.backgroundView
+        collectionView.reloadData()
     }
     
     // MARK: DZNEmpty

+ 3 - 1
iOSClient/UploadFromOtherUpp/CCUploadFromOtherUpp.m

@@ -56,7 +56,9 @@
 
 - (void)changeTheming
 {
-    [appDelegate changeTheming:self tableView:self.tableView collectionView:nil form:true];
+    self.view.backgroundColor = NCBrandColor.sharedInstance.backgroundForm;
+    self.tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundForm;
+    [self.tableView reloadData];
 }
 
 #pragma --------------------------------------------------------------------------------------------