Marino Faggiana 1 vuosi sitten
vanhempi
commit
99d2ad2910

+ 2 - 26
iOSClient/Viewer/NCViewerMedia/NCViewerMedia.swift

@@ -125,6 +125,8 @@ class NCViewerMedia: UIViewController {
         self.image = nil
         self.imageVideoContainer.image = nil
 
+        viewerMediaPage?.changeScreenMode(mode: viewerMediaScreenMode)
+
         loadImage()
     }
 
@@ -140,32 +142,6 @@ class NCViewerMedia: UIViewController {
                 loadImage()
             }
         }
-
-        if viewerMediaScreenMode == .normal {
-
-            viewerMediaPage?.navigationController?.setNavigationBarHidden(false, animated: true)
-
-            if metadata.isMovie {
-                viewerMediaPage?.view.backgroundColor = .black
-                viewerMediaPage?.textColor = .white
-            } else {
-                viewerMediaPage?.view.backgroundColor = .systemBackground
-                viewerMediaPage?.textColor = .label
-            }
-            viewerMediaPage?.progressView.isHidden = false
-
-            NCUtility.shared.colorNavigationController(viewerMediaPage?.navigationController, backgroundColor: .systemBackground, titleColor: .label, tintColor: nil, withoutShadow: false)
-
-        } else {
-
-            viewerMediaPage?.navigationController?.setNavigationBarHidden(true, animated: true)
-
-            viewerMediaPage?.view.backgroundColor = .black
-            viewerMediaPage?.textColor = .white
-            viewerMediaPage?.progressView.isHidden = true
-
-            NCUtility.shared.colorNavigationController(viewerMediaPage?.navigationController, backgroundColor: .black, titleColor: .white, tintColor: nil, withoutShadow: false)
-        }
     }
 
     override func viewDidAppear(_ animated: Bool) {

+ 3 - 1
iOSClient/Viewer/NCViewerMedia/NCViewerMediaPage.swift

@@ -217,7 +217,6 @@ class NCViewerMediaPage: UIViewController {
 
         let metadata = currentViewController.metadata
         let fullscreen = currentViewController.playerToolBar?.isFullscreen ?? false
-        NCUtility.shared.colorNavigationController(navigationController, backgroundColor: .systemBackground, titleColor: .label, tintColor: nil, withoutShadow: false)
 
         if mode == .normal {
 
@@ -232,10 +231,12 @@ class NCViewerMediaPage: UIViewController {
             }
 
             if metadata.isMovie {
+                NCUtility.shared.colorNavigationController(navigationController, backgroundColor: .black, titleColor: .label, tintColor: nil, withoutShadow: false)
                 currentViewController.playerToolBar?.show()
                 view.backgroundColor = .black
                 textColor = .white
             } else {
+                NCUtility.shared.colorNavigationController(navigationController, backgroundColor: .systemBackground, titleColor: .label, tintColor: nil, withoutShadow: false)
                 view.backgroundColor = .systemBackground
                 textColor = .label
             }
@@ -578,6 +579,7 @@ extension NCViewerMediaPage: UIPageViewControllerDelegate, UIPageViewControllerD
             }
             currentIndex = nextIndex!
         }
+        changeScreenMode(mode: viewerMediaScreenMode)
 
         self.nextIndex = nil
     }