marinofaggiana 3 жил өмнө
parent
commit
ec240c1648

+ 0 - 17
iOSClient/Viewer/NCViewerMedia/NCViewerMedia.swift

@@ -98,23 +98,6 @@ class NCViewerMedia: UIViewController {
     override func viewWillAppear(_ animated: Bool) {
         super.viewWillAppear(animated)
     
-        navigationController?.navigationBar.prefersLargeTitles = false
-
-        if currentMode == .full {
-            
-            navigationController?.setNavigationBarHidden(true, animated: false)
-            view.backgroundColor = .black
-            textColor = .white
-            progressView.isHidden = true
-            
-        } else {
-            
-            navigationController?.setNavigationBarHidden(false, animated: false)
-            view.backgroundColor = NCBrandColor.shared.systemBackground
-            textColor = NCBrandColor.shared.label
-            progressView.isHidden = false
-        }
-        
         NotificationCenter.default.addObserver(self, selector: #selector(deleteFile(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterDeleteFile), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(renameFile(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterRenameFile), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(moveFile(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterMoveFile), object: nil)

+ 28 - 2
iOSClient/Viewer/NCViewerMedia/NCViewerMediaZoom.swift

@@ -110,9 +110,35 @@ class NCViewerMediaZoom: UIViewController {
     override func viewWillAppear(_ animated: Bool) {
         super.viewWillAppear(animated)
         
-        viewerMedia?.navigationItem.title = metadata.fileNameView
-        
         imageVideoContainer.image = image
+
+        viewerMedia?.navigationController?.navigationBar.prefersLargeTitles = false
+        viewerMedia?.navigationItem.title = metadata.fileNameView
+                
+        if viewerMedia?.currentMode == .full {
+            
+            viewerMedia?.navigationController?.setNavigationBarHidden(true, animated: false)
+            viewerMedia?.view.backgroundColor = .black
+            viewerMedia?.textColor = .white
+            viewerMedia?.progressView.isHidden = true
+            
+        } else {
+            
+            viewerMedia?.navigationController?.setNavigationBarHidden(false, animated: false)
+            
+            if (!metadata.livePhoto && metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue) {
+                
+                viewerMedia?.view.backgroundColor = .black
+                viewerMedia?.textColor = .white
+                
+            } else {
+                
+                viewerMedia?.view.backgroundColor = NCBrandColor.shared.systemBackground
+                viewerMedia?.textColor = NCBrandColor.shared.label
+            }
+
+            viewerMedia?.progressView.isHidden = false
+        }
     }
     
     override func viewDidAppear(_ animated: Bool) {