Browse Source

dark mode

marinofaggiana 5 years ago
parent
commit
26485e5aec

+ 6 - 15
iOSClient/Main/CCMain.m

@@ -3636,19 +3636,10 @@
     else titleSection = NSLocalizedString(titleSection,nil);
     
     // Format title
-    NSString *currentDevice = [CCUtility currentDevice];
-    if ([currentDevice rangeOfString:@"iPad3"].location != NSNotFound) {
-        
-        visualEffectView = [[UIVisualEffectView alloc] init];
-        visualEffectView.backgroundColor = [NCBrandColor.sharedInstance.brand colorWithAlphaComponent:0.3];
-        
-    } else {
-        
-        UIVisualEffect *blurEffect;
-        blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
-        visualEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
-        visualEffectView.backgroundColor = [NCBrandColor.sharedInstance.brand colorWithAlphaComponent:0.2];
-    }
+    UIVisualEffect *blurEffect;
+    blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
+    visualEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
+    visualEffectView.backgroundColor = [NCBrandColor.sharedInstance.brand colorWithAlphaComponent:0.2];
     
     if ([[CCUtility getGroupBySettings] isEqualToString:@"alphabetic"]) {
         
@@ -3662,7 +3653,7 @@
     // Title
     UILabel *titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, -12, 0, 44)];
     titleLabel.backgroundColor = [UIColor clearColor];
-    titleLabel.textColor = [UIColor blackColor];
+    titleLabel.textColor = NCBrandColor.sharedInstance.textView;
     titleLabel.font = [UIFont systemFontOfSize:12];
     titleLabel.textAlignment = NSTextAlignmentLeft;
     titleLabel.text = titleSection;
@@ -3673,7 +3664,7 @@
     // Elements
     UILabel *elementLabel= [[UILabel alloc]initWithFrame:CGRectMake(shift, -12, 0, 44)];
     elementLabel.backgroundColor = [UIColor clearColor];
-    elementLabel.textColor = [UIColor blackColor];;
+    elementLabel.textColor = NCBrandColor.sharedInstance.textView;
     elementLabel.font = [UIFont systemFontOfSize:12];
     elementLabel.textAlignment = NSTextAlignmentRight;
     elementLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth;

+ 4 - 0
iOSClient/Main/Create cloud/NCCreateFormUploadRichdocuments.swift

@@ -127,6 +127,10 @@ class NCCreateFormUploadRichdocuments: XLFormViewController, NCSelectDelegate, U
         
         row.cellConfig["textField.textAlignment"] = NSTextAlignment.right.rawValue
         row.cellConfig["textField.font"] = UIFont.systemFont(ofSize: 15.0)
+        row.cellConfig["textField.textColor"] = NCBrandColor.sharedInstance.textView
+        
+        row.cellConfig["textLabel.textAlignment"] = NSTextAlignment.right.rawValue
+        row.cellConfig["textLabel.font"] = UIFont.systemFont(ofSize: 15.0)
         row.cellConfig["textLabel.textColor"] = NCBrandColor.sharedInstance.textView
         
         section.addFormRow(row)

+ 1 - 1
iOSClient/Main/NCMainCommon.swift

@@ -690,8 +690,8 @@ class NCMainCommon: NSObject, PhotoEditorDelegate, NCAudioRecorderViewController
             
             cell.backgroundColor = NCBrandColor.sharedInstance.backgroundView
 
-            cell.labelTitle.textColor = UIColor.black
             cell.labelTitle.text = metadata.fileNameView
+            cell.labelTitle.textColor = NCBrandColor.sharedInstance.textView
             
             cell.transferButton.tintColor = NCBrandColor.sharedInstance.optionItem
             

+ 14 - 2
iOSClient/Main/NCPhotosPickerViewController.swift

@@ -79,14 +79,26 @@ class NCPhotosPickerViewController: NSObject {
 
 class customPhotoPickerViewController: TLPhotosPickerViewController {
     
+    override var preferredStatusBarStyle: UIStatusBarStyle {
+        return .lightContent
+    }
+    
     override func makeUI() {
         super.makeUI()
         
-        self.customNavItem.leftBarButtonItem?.tintColor = NCBrandColor.sharedInstance.icon
-        self.customNavItem.rightBarButtonItem?.tintColor = NCBrandColor.sharedInstance.icon
+        self.customNavItem.leftBarButtonItem?.tintColor = NCBrandColor.sharedInstance.textView
+        self.customNavItem.rightBarButtonItem?.tintColor = NCBrandColor.sharedInstance.textView
         
         self.titleLabel.textColor = NCBrandColor.sharedInstance.icon
         self.subTitleLabel.textColor = NCBrandColor.sharedInstance.graySoft
         self.subTitleArrowImageView.image = CCGraphics.changeThemingColorImage(self.subTitleArrowImageView.image, multiplier: 1, color: NCBrandColor.sharedInstance.graySoft)
+        
+        self.collectionView.backgroundColor = NCBrandColor.sharedInstance.backgroundView
+        self.view.backgroundColor = NCBrandColor.sharedInstance.backgroundView
+        if CCUtility.getDarkMode() {
+            self.navigationBar.barStyle = .black
+        }
+        self.titleLabel.textColor = NCBrandColor.sharedInstance.textView
+        self.subTitleLabel.textColor = NCBrandColor.sharedInstance.textView
     }
 }

+ 2 - 3
iOSClient/Main/Section/NCSectionHeaderFooter.swift

@@ -46,8 +46,7 @@ class NCSectionHeaderMenu: UICollectionReusableView {
         
         buttonMore.setImage(CCGraphics.changeThemingColorImage(UIImage.init(named: "more"), multiplier: 2, color: NCBrandColor.sharedInstance.icon), for: .normal)
         
-        viewLabelSection.backgroundColor = NCBrandColor.sharedInstance.brand.withAlphaComponent(0.1)
-        
+        viewLabelSection.backgroundColor = NCBrandColor.sharedInstance.select
         separator.backgroundColor = NCBrandColor.sharedInstance.separator
         self.backgroundColor = NCBrandColor.sharedInstance.backgroundView
     }
@@ -138,7 +137,7 @@ class NCSectionHeader: UICollectionReusableView {
     override func awakeFromNib() {
         super.awakeFromNib()
         
-        self.backgroundColor = NCBrandColor.sharedInstance.brand.withAlphaComponent(0.1)
+        self.backgroundColor = NCBrandColor.sharedInstance.select
     }
     
     func setTitleLabel(sectionDatasource: CCSectionDataSourceMetadata, section: Int) {