Browse Source

new view image

marinofaggiana 4 years ago
parent
commit
e62caa9ede

+ 1 - 1
Nextcloud.xcodeproj/project.pbxproj

@@ -1120,12 +1120,12 @@
 			isa = PBXGroup;
 			children = (
 				F7F9D1BA25397CE000D9BFF5 /* NCViewer.swift */,
+				F79018B1240962C7007C9B6D /* NCViewerImage */,
 				F723986A253C9C0E00257F49 /* NCViewerQuickLook */,
 				F76D3CEF2428B3DD005DFA87 /* NCViewerPDF */,
 				F71CEB0D253A0B1A00832FFE /* NCViewerVideo */,
 				F73D11FF253C5F5400DF9BEC /* NCViewerNextcloudText */,
 				F7239861253C95D500257F49 /* NCViewerRichdocument */,
-				F79018B1240962C7007C9B6D /* NCViewerImage */,
 			);
 			path = Viewer;
 			sourceTree = "<group>";

+ 2 - 2
iOSClient/Main/Main.storyboard

@@ -3,7 +3,7 @@
     <device id="retina6_1" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17126"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <scenes>
@@ -83,7 +83,7 @@
         <!--Media-->
         <scene sceneID="IuY-Iu-oAm">
             <objects>
-                <navigationController extendedLayoutIncludesOpaqueBars="YES" automaticallyAdjustsScrollViewInsets="NO" id="Npr-vu-PSD" userLabel="Media" customClass="NCMainNavigationController" customModule="Nextcloud" customModuleProvider="target" sceneMemberID="viewController">
+                <navigationController extendedLayoutIncludesOpaqueBars="YES" automaticallyAdjustsScrollViewInsets="NO" id="Npr-vu-PSD" customClass="NCMainNavigationController" customModule="Nextcloud" customModuleProvider="target" sceneMemberID="viewController">
                     <tabBarItem key="tabBarItem" title="Media" id="5cw-bP-7It"/>
                     <toolbarItems/>
                     <navigationBar key="navigationBar" contentMode="scaleToFill" largeTitles="YES" id="ixg-Pw-TNO">

+ 4 - 2
iOSClient/Media/NCMedia.swift

@@ -123,6 +123,9 @@ class NCMedia: UIViewController, NCEmptyDataSetDelegate, NCSelectDelegate {
     override func viewWillAppear(_ animated: Bool) {
         super.viewWillAppear(animated)
         
+        // hide nagigation controller
+        self.navigationController?.setNavigationBarHidden(true, animated: false)
+
         self.reloadDataSourceWithCompletion { (_) in
             self.searchNewPhotoVideo()
         }
@@ -392,8 +395,6 @@ class NCMedia: UIViewController, NCEmptyDataSetDelegate, NCSelectDelegate {
         cacheImages.cellLivePhotoImage = CCGraphics.changeThemingColorImage(UIImage.init(named: "livePhoto"), width: 100, height: 100, color: .white)
         cacheImages.cellPlayImage = CCGraphics.changeThemingColorImage(UIImage.init(named: "play"), width: 100, height: 100, color: .white)
         cacheImages.cellFavouriteImage = CCGraphics.changeThemingColorImage(UIImage.init(named: "favorite"), width: 100, height: 100, color: NCBrandColor.sharedInstance.yellowFavorite)
-        
-        self.navigationController?.setNavigationBarHidden(true, animated: false)
     }
 
     @objc func deleteFile(_ notification: NSNotification) {
@@ -520,6 +521,7 @@ extension NCMedia: UICollectionViewDelegate {
             
         } else {
             
+            appDelegate.activeServerUrl = metadataTouch!.serverUrl
             NCViewer.shared.view(viewController: self, metadata: metadataTouch!, metadatas: metadatas)
         }
     }

+ 1 - 1
iOSClient/Viewer/NCViewer.swift

@@ -199,7 +199,7 @@ class NCViewer: NSObject {
     
     private func getPushNavigationController(viewController: UIViewController, serverUrl: String) -> UINavigationController? {
         
-        if viewController is NCFiles || viewController is NCFavorite || viewController is NCOffline || viewController is NCRecent || viewController is NCFileViewInFolder {
+        if viewController is NCFiles || viewController is NCFavorite || viewController is NCOffline || viewController is NCRecent || viewController is NCFileViewInFolder || viewController is NCMedia {
             if serverUrl == appDelegate.activeServerUrl {
                 return viewController.navigationController
             }

+ 2 - 2
iOSClient/Viewer/NCViewerImage/NCViewerImage.storyboard

@@ -9,7 +9,7 @@
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <scenes>
-        <!--Zoom-->
+        <!--Viewer Image Page Container-->
         <scene sceneID="yQe-Pb-BKZ">
             <objects>
                 <viewController automaticallyAdjustsScrollViewInsets="NO" hidesBottomBarWhenPushed="YES" id="ne8-hS-cp3" customClass="NCViewerImagePageContainer" customModule="Nextcloud" customModuleProvider="target" sceneMemberID="viewController">
@@ -37,7 +37,7 @@
                             <constraint firstAttribute="trailing" secondItem="fpt-Rz-5fT" secondAttribute="trailing" id="xh9-IP-ti7"/>
                         </constraints>
                     </view>
-                    <navigationItem key="navigationItem" title="Zoom" id="azh-DM-TLz"/>
+                    <navigationItem key="navigationItem" id="azh-DM-TLz"/>
                     <nil key="simulatedBottomBarMetrics"/>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="qhs-BU-mEq" userLabel="First Responder" sceneMemberID="firstResponder"/>

+ 1 - 0
iOSClient/Viewer/NCViewerImage/NCViewerImagePageContainer.swift

@@ -80,6 +80,7 @@ class NCViewerImagePageContainer: UIViewController, UIGestureRecognizerDelegate
         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?.setNavigationBarHidden(false, animated: true)
         navigationController?.navigationBar.prefersLargeTitles = true
     }