Browse Source

dark mode

marinofaggiana 5 years ago
parent
commit
28480117c0

+ 1 - 1
iOSClient/Activity/NCActivity.swift

@@ -74,7 +74,7 @@ class NCActivity: UIViewController, DZNEmptyDataSetSource, DZNEmptyDataSetDelega
     }
     
     @objc func changeTheming() {
-        appDelegate.changeTheming(self, tableView: tableView, collectionView: nil)
+        appDelegate.changeTheming(self, tableView: tableView, collectionView: nil, form: false)
     }
     
     // MARK: DZNEmpty

+ 1 - 1
iOSClient/AppDelegate.h

@@ -168,7 +168,7 @@
 
 // Theming Color
 - (void)settingThemingColorBrand;
-- (void)changeTheming:(UIViewController *)viewController tableView:(UITableView *)tableView collectionView:(UICollectionView *)collectionView;
+- (void)changeTheming:(UIViewController *)viewController tableView:(UITableView *)tableView collectionView:(UICollectionView *)collectionView form:(BOOL)form;
 
 // Task Networking
 - (void)loadAutoDownloadUpload;

+ 8 - 5
iOSClient/AppDelegate.m

@@ -999,14 +999,15 @@ PKPushRegistry *pushRegistry;
     [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"changeTheming" object:nil];
 }
 
-- (void)changeTheming:(UIViewController *)viewController tableView:(UITableView *)tableView collectionView:(UICollectionView *)collectionView
+- (void)changeTheming:(UIViewController *)viewController tableView:(UITableView *)tableView collectionView:(UICollectionView *)collectionView form:(BOOL)form
 {
     // Dark Mode
     [NCBrandColor.sharedInstance setDarkMode];
     
     // View
-    viewController.view.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
-
+    if (form) viewController.view.backgroundColor = NCBrandColor.sharedInstance.backgroundForm;
+    else viewController.view.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
+        
     // NavigationBar
     if (viewController.navigationController.navigationBar) {
         viewController.navigationController.navigationBar.translucent = NO;
@@ -1039,14 +1040,16 @@ PKPushRegistry *pushRegistry;
                 
     // TableView
     if (tableView) {
-        tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
+        if (form) tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundForm;
+        else tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
         tableView.separatorColor = NCBrandColor.sharedInstance.separator;
         [tableView reloadData];
     }
     
     // CollectionView
     if (collectionView) {
-        collectionView.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
+        if (form) collectionView.backgroundColor = NCBrandColor.sharedInstance.backgroundForm;
+        else collectionView.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
         [collectionView reloadData];
     }
     

+ 1 - 1
iOSClient/Favorites/CCFavorites.m

@@ -111,7 +111,7 @@
 
 - (void)changeTheming
 {
-    [appDelegate changeTheming:self tableView:self.tableView collectionView:nil];
+    [appDelegate changeTheming:self tableView:self.tableView collectionView:nil form:false];
 }
 
 #pragma --------------------------------------------------------------------------------------------

+ 1 - 1
iOSClient/Main/CCDetail.m

@@ -127,7 +127,7 @@
 
 - (void)changeTheming
 {
-    [appDelegate changeTheming:self tableView:nil collectionView:nil];
+    [appDelegate changeTheming:self tableView:nil collectionView:nil form:false];
     
     if (self.toolbar) {
         self.toolbar.barTintColor = NCBrandColor.sharedInstance.tabBar;

+ 1 - 1
iOSClient/Main/CCMain.m

@@ -270,7 +270,7 @@
 
 - (void)changeTheming
 {
-    [appDelegate changeTheming:self tableView:self.tableView collectionView:nil];
+    [appDelegate changeTheming:self tableView:self.tableView collectionView:nil form:false];
     
     // createImagesThemingColor
     [[NCMainCommon sharedInstance] createImagesThemingColor];

+ 1 - 1
iOSClient/Main/CCMore.swift

@@ -188,7 +188,7 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
     
     @objc func changeTheming() {
         
-        appDelegate.changeTheming(self, tableView: tableView, collectionView: nil)
+        appDelegate.changeTheming(self, tableView: tableView, collectionView: nil, form: false)
 
         self.view.backgroundColor = NCBrandColor.sharedInstance.brand
         viewQuota.backgroundColor = NCBrandColor.sharedInstance.backgroundView;

+ 1 - 1
iOSClient/Main/Create cloud/NCCreateFormUploadRichdocuments.swift

@@ -130,7 +130,7 @@ class NCCreateFormUploadRichdocuments: XLFormViewController, NCSelectDelegate, U
     }
 
     @objc func changeTheming() {
-        appDelegate.changeTheming(self, tableView: tableView, collectionView: collectionView)
+        appDelegate.changeTheming(self, tableView: tableView, collectionView: collectionView, form: false)
         initializeForm()
     }
     

+ 1 - 1
iOSClient/Media/NCMedia.swift

@@ -152,7 +152,7 @@ class NCMedia: UIViewController, DropdownMenuDelegate, DZNEmptyDataSetSource, DZ
     }
     
     @objc func changeTheming() {
-        appDelegate.changeTheming(self, tableView: nil, collectionView: collectionView)
+        appDelegate.changeTheming(self, tableView: nil, collectionView: collectionView, form: false)
     }
 
     // MARK: DZNEmpty

+ 1 - 1
iOSClient/Notification/CCNotification.swift

@@ -50,7 +50,7 @@ class CCNotification: UITableViewController, CCNotificationCelllDelegate {
     }
     
      @objc func changeTheming() {
-           appDelegate.changeTheming(self, tableView: tableView, collectionView: nil)
+           appDelegate.changeTheming(self, tableView: tableView, collectionView: nil, form: false)
        }
 
     @objc func viewClose() {

+ 1 - 1
iOSClient/Offline/NCOffline.swift

@@ -144,7 +144,7 @@ class NCOffline: UIViewController, UIGestureRecognizerDelegate, NCListCellDelega
     }
     
     @objc func changeTheming() {
-        appDelegate.changeTheming(self, tableView: nil, collectionView: collectionView)
+        appDelegate.changeTheming(self, tableView: nil, collectionView: collectionView, form: false)
     }
     
     // MARK: DZNEmpty

+ 1 - 1
iOSClient/ScanDocument/ScanCollectionView.swift

@@ -110,7 +110,7 @@ class DragDropViewController: UIViewController {
     }
     
     @objc func changeTheming() {
-        appDelegate.changeTheming(self, tableView: nil, collectionView: nil)
+        appDelegate.changeTheming(self, tableView: nil, collectionView: nil, form: false)
         
         collectionViewSource.backgroundColor = NCBrandColor.sharedInstance.backgroundView
         collectionViewDestination.backgroundColor = NCBrandColor.sharedInstance.backgroundView

+ 1 - 1
iOSClient/Select/NCSelect.swift

@@ -179,7 +179,7 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, NCListCellDelegat
     }
     
     @objc func changeTheming() {
-        appDelegate.changeTheming(self, tableView: nil, collectionView: collectionView)
+        appDelegate.changeTheming(self, tableView: nil, collectionView: collectionView, form: false)
     }
     
     // MARK: DZNEmpty

+ 1 - 1
iOSClient/Settings/Acknowledgements.m

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

+ 1 - 1
iOSClient/Settings/CCAdvanced.m

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

+ 1 - 1
iOSClient/Settings/CCManageAccount.m

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

+ 1 - 1
iOSClient/Settings/CCManageAutoUpload.m

@@ -215,7 +215,7 @@
 
 - (void)changeTheming
 {
-    [appDelegate changeTheming:self tableView:self.tableView collectionView:nil];
+    [appDelegate changeTheming:self tableView:self.tableView collectionView:nil form:false];
     [self initializeForm];
     [self reloadForm];
 }

+ 1 - 1
iOSClient/Settings/CCSettings.m

@@ -196,7 +196,7 @@
 
 - (void)changeTheming
 {
-    [appDelegate changeTheming:self tableView:self.tableView collectionView:nil];
+    [appDelegate changeTheming:self tableView:self.tableView collectionView:nil form:false];
     [self initializeForm];
     [self reloadForm];
 }

+ 1 - 1
iOSClient/Settings/NCManageAutoUploadFileName.swift

@@ -168,7 +168,7 @@ class NCManageAutoUploadFileName: XLFormViewController {
     }
     
     @objc func changeTheming() {
-        appDelegate.changeTheming(self, tableView: tableView, collectionView: nil)
+        appDelegate.changeTheming(self, tableView: tableView, collectionView: nil, form: false)
         initializeForm()
         self.reloadForm()
     }

+ 1 - 1
iOSClient/Settings/NCManageEndToEndEncryption.m

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

+ 1 - 1
iOSClient/Share/NCShare.swift

@@ -107,7 +107,7 @@ class NCShare: UIViewController, UIGestureRecognizerDelegate, NCShareLinkCellDel
     }
     
     @objc func changeTheming() {
-        appDelegate.changeTheming(self, tableView: tableView, collectionView: nil)
+        appDelegate.changeTheming(self, tableView: tableView, collectionView: nil, form: false)
         
         shareLinkLabel.textColor = NCBrandColor.sharedInstance.textView
     }

+ 1 - 1
iOSClient/Share/NCShareComments.swift

@@ -96,7 +96,7 @@ class NCShareComments: UIViewController, NCShareCommentsCellDelegate {
     }
     
     @objc func changeTheming() {
-        appDelegate.changeTheming(self, tableView: tableView, collectionView: nil)
+        appDelegate.changeTheming(self, tableView: tableView, collectionView: nil, form: false)
         
         labelUser.textColor = NCBrandColor.sharedInstance.textView
     }

+ 4 - 4
iOSClient/Share/NCSharePaging.swift

@@ -74,10 +74,10 @@ class NCSharePaging: UIViewController {
     }
     
     @objc func changeTheming() {
-        appDelegate.changeTheming(self, tableView: nil, collectionView: nil)
+        appDelegate.changeTheming(self, tableView: nil, collectionView: nil, form: false)
         
-        pagingViewController.backgroundColor = NCBrandColor.sharedInstance.backgroundView
-        pagingViewController.selectedBackgroundColor = NCBrandColor.sharedInstance.backgroundView
+        pagingViewController.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
+        pagingViewController.selectedBackgroundColor = NCBrandColor.sharedInstance.backgroundForm
         pagingViewController.textColor = NCBrandColor.sharedInstance.textView
         pagingViewController.selectedTextColor = NCBrandColor.sharedInstance.textView
         pagingViewController.indicatorColor = NCBrandColor.sharedInstance.brand
@@ -187,7 +187,7 @@ class NCSharePagingView: PagingView {
     override func setupConstraints() {
         
         let headerView = Bundle.main.loadNibNamed("NCShareHeaderView", owner: self, options: nil)?.first as! NCShareHeaderView
-        headerView.backgroundColor = NCBrandColor.sharedInstance.backgroundView
+        headerView.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
         headerView.ocId = metadata!.ocId
         
         if FileManager.default.fileExists(atPath: CCUtility.getDirectoryProviderStorageIconOcId(metadata!.ocId, fileNameView: metadata!.fileNameView)) {

+ 1 - 1
iOSClient/Shares/NCShares.m

@@ -81,7 +81,7 @@
 
 - (void)changeTheming
 {
-    [appDelegate changeTheming:self tableView:self.tableView collectionView:nil];
+    [appDelegate changeTheming:self tableView:self.tableView collectionView:nil form:false];
 }
 
 #pragma --------------------------------------------------------------------------------------------

+ 1 - 1
iOSClient/Text/NCText.swift

@@ -125,7 +125,7 @@ class NCText: UIViewController, UITextViewDelegate {
     
     @objc func changeTheming() {
     
-        appDelegate.changeTheming(self, tableView: nil, collectionView: nil)
+        appDelegate.changeTheming(self, tableView: nil, collectionView: nil, form: false)
         
         textView.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
         textView.textColor = NCBrandColor.sharedInstance.textView

+ 1 - 1
iOSClient/Transfers/CCTransfers.m

@@ -97,7 +97,7 @@
 
 - (void)changeTheming
 {
-    [appDelegate changeTheming:self tableView:self.tableView collectionView:nil];
+    [appDelegate changeTheming:self tableView:self.tableView collectionView:nil form:false];
 }
 
 #pragma --------------------------------------------------------------------------------------------

+ 1 - 1
iOSClient/Trash/NCTrash.swift

@@ -122,7 +122,7 @@ class NCTrash: UIViewController, UIGestureRecognizerDelegate, NCTrashListCellDel
     }
     
     @objc func changeTheming() {
-        appDelegate.changeTheming(self, tableView: nil, collectionView: collectionView)
+        appDelegate.changeTheming(self, tableView: nil, collectionView: collectionView, form: false)
         
         refreshControl.tintColor = NCBrandColor.sharedInstance.brandText
         refreshControl.backgroundColor = NCBrandColor.sharedInstance.brand

+ 1 - 1
iOSClient/UploadFromOtherUpp/CCUploadFromOtherUpp.m

@@ -57,7 +57,7 @@
 
 - (void)changeTheming
 {
-    [appDelegate changeTheming:self tableView:self.tableView collectionView:nil];
+    [appDelegate changeTheming:self tableView:self.tableView collectionView:nil form:false];
 }
 
 #pragma --------------------------------------------------------------------------------------------