marinofaggiana 5 лет назад
Родитель
Сommit
fe97fa377e

+ 0 - 2
iOSClient/Main/CCSplit.m

@@ -275,7 +275,6 @@
     // simply create a property of 'BOOL' type
     BOOL isRunningInFullScreen = CGRectEqualToRect([UIApplication sharedApplication].delegate.window.frame, [UIApplication sharedApplication].delegate.window.screen.bounds);
     
-    /*
     // detect Dark Mode
     if (@available(iOS 13.0, *)) {
         appDelegate.preferredUserInterfaceStyle = self.traitCollection.userInterfaceStyle;
@@ -289,7 +288,6 @@
             [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"changeTheming" object:nil];
         }
     }
-    */
     
     prevRunningInFullScreen = isRunningInFullScreen;
     

+ 8 - 21
iOSClient/Main/Create cloud/NCCreateFormUploadScanDocument.swift

@@ -675,33 +675,20 @@ class NCCreateScanDocument : NSObject, ImageScannerControllerDelegate {
         
         let fileName = CCUtility.createFileName("scan.png", fileDate: Date(), fileType: PHAssetMediaType.image, keyFileName: k_keyFileNameMask, keyFileNameType: k_keyFileNameType, keyFileNameOriginal: k_keyFileNameOriginal)!
         let fileNamePath = CCUtility.getDirectoryScan() + "/" + fileName
+        let image: UIImage?
         
-        if let image = results.enhancedScan?.image {
-            do {
-                try image.pngData()?.write(to: NSURL.fileURL(withPath: fileNamePath))
-            } catch { }
+        if results.doesUserPreferEnhancedScan {
+            image = results.enhancedScan?.image
+        } else {
+            image = results.originalScan.image
         }
         
-        // V 1.0
-        /*
-        if (results.doesUserPreferEnhancedImage && results.enhancedImage != nil) {
+        if image != nil {
             do {
-                try results.enhancedImage!.pngData()?.write(to: NSURL.fileURL(withPath: fileNamePath), options: .atomic)
-            } catch { }
-        } else {
-            do {
-                try results.scannedImage.pngData()?.write(to: NSURL.fileURL(withPath: fileNamePath), options: .atomic)
+                try image!.pngData()?.write(to: NSURL.fileURL(withPath: fileNamePath))
             } catch { }
         }
-        */
-        
-        // 0.9.1
-        /*
-        do {
-            try results.scannedImage.pngData()?.write(to: NSURL.fileURL(withPath: fileNamePath), options: .atomic)
-        } catch { }
-        */
-        
+
         scanner.dismiss(animated: true, completion: {
             if (self.openScan) {
                 let storyboard = UIStoryboard(name: "Scan", bundle: nil)

+ 0 - 2
iOSClient/Settings/CCSettings.m

@@ -111,7 +111,6 @@
     [form addFormSection:section];
     
     // Dark Mode
-    /*
     if (@available(iOS 13.0, *)) {
         row = [XLFormRowDescriptor formRowDescriptorWithTag:@"darkModeDetect" rowType:XLFormRowDescriptorTypeBooleanSwitch title:[NSString stringWithFormat:@"%@ (beta)", NSLocalizedString(@"_dark_mode_detect_", nil)]];
         row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.sharedInstance.backgroundView;
@@ -122,7 +121,6 @@
         else row.value = @0;
         [section addFormRow:row];
     }
-    */
     
     row = [XLFormRowDescriptor formRowDescriptorWithTag:@"darkMode" rowType:XLFormRowDescriptorTypeBooleanSwitch title:[NSString stringWithFormat:@"%@ (beta)", NSLocalizedString(@"_dark_mode_", nil)]];
     row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.sharedInstance.backgroundView;