marinofaggiana 4 年之前
父节点
当前提交
d4588954d6

+ 1 - 2
iOSClient/Viewer/NCViewer.swift

@@ -41,7 +41,7 @@ class NCViewer: NSObject {
                 let viewController:NCViewerVideo = UIStoryboard(name: "NCViewerVideo", bundle: nil).instantiateInitialViewController() as! NCViewerVideo
             
                 viewController.metadata = metadata
-            
+
                 navigationController.pushViewController(viewController, animated: true)
             }
             return
@@ -57,7 +57,6 @@ class NCViewer: NSObject {
                     let viewController:NCViewerPDF = UIStoryboard(name: "NCViewerPDF", bundle: nil).instantiateInitialViewController() as! NCViewerPDF
                 
                     viewController.metadata = metadata
-                    viewController.viewer = self
                 
                     navigationController.pushViewController(viewController, animated: true)
                 }

+ 1 - 2
iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift

@@ -28,7 +28,6 @@ class NCViewerPDF: UIViewController, NCViewerPDFSearchDelegate {
     
     let appDelegate = UIApplication.shared.delegate as! AppDelegate
     var metadata = tableMetadata()
-    var viewer: NCViewer?
     
     private var pdfView = PDFView()
     private var thumbnailViewHeight: CGFloat = 40
@@ -134,7 +133,7 @@ class NCViewerPDF: UIViewController, NCViewerPDFSearchDelegate {
     //MARK: - Action
     
     @objc func openMenuMore() {
-        viewer?.toggleMoreMenu(viewController: self, metadata: metadata)
+        NCViewer.shared.toggleMoreMenu(viewController: self, metadata: metadata)
     }
     
     //MARK: - NotificationCenter

+ 1 - 1
iOSClient/Viewer/NCViewerVideo/NCViewerVideo.storyboard

@@ -12,7 +12,7 @@
         <!--Viewer Video-->
         <scene sceneID="puT-XC-QL4">
             <objects>
-                <viewController modalPresentationStyle="fullScreen" id="Mmv-kq-uRN" customClass="NCViewerVideo" customModule="Nextcloud" customModuleProvider="target" sceneMemberID="viewController">
+                <viewController modalPresentationStyle="fullScreen" hidesBottomBarWhenPushed="YES" id="Mmv-kq-uRN" customClass="NCViewerVideo" customModule="Nextcloud" customModuleProvider="target" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="ZUd-xF-jbc">
                         <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>

+ 19 - 1
iOSClient/Viewer/NCViewerVideo/NCViewerVideo.swift

@@ -31,7 +31,7 @@ class NCViewerVideo: UIViewController {
     @IBOutlet weak var closeButton: UIButton!
 
     let appDelegate = UIApplication.shared.delegate as! AppDelegate
-    @objc var metadata = tableMetadata()
+    var metadata = tableMetadata()
 
     required init?(coder: NSCoder) {
         super.init(coder: coder)        
@@ -49,6 +49,24 @@ class NCViewerVideo: UIViewController {
         NCViewerVideoCommon.sharedInstance.viewMedia(metadata, view: backgroundView, frame: frame)
     }
     
+    override func viewWillAppear(_ animated: Bool) {
+        super.viewWillAppear(animated)
+
+        let buttonMore = UIBarButtonItem.init(image: CCGraphics.changeThemingColorImage(UIImage(named: "more"), width: 50, height: 50, color: NCBrandColor.sharedInstance.textView), style: .plain, target: self, action: #selector(self.openMenuMore))
+        navigationItem.rightBarButtonItem = buttonMore
+        
+        navigationController?.navigationBar.prefersLargeTitles = true
+        navigationItem.title = metadata.fileNameView
+
+        appDelegate.activeViewController = self
+    }
+    
+    //MARK: - Action
+    
+    @objc func openMenuMore() {
+        NCViewer.shared.toggleMoreMenu(viewController: self, metadata: metadata)
+    }
+    
     @IBAction func touchUpInsidecloseButton(_ sender: Any) {
         
         if appDelegate.player != nil && appDelegate.player.rate != 0 {