Browse Source

new view image

marinofaggiana 4 years ago
parent
commit
45d7a1c013

+ 1 - 3
iOSClient/Main/Menu/NCViewer+Menu.swift

@@ -244,9 +244,8 @@ extension NCViewer {
         //
         // IMAGE - VIDEO - AUDIO
         //
-        /*
         if metadata.session == "" {
-            if (metadata.typeFile == k_metadataTypeFile_image || metadata.typeFile == k_metadataTypeFile_video || metadata.typeFile == k_metadataTypeFile_audio) && !CCUtility.fileProviderStorageExists(appDelegate.activeDetail.metadata?.ocId, fileNameView: appDelegate.activeDetail.metadata?.fileNameView) && metadata.session == "" && metadata.typeFile == k_metadataTypeFile_image {
+            if metadata.typeFile == k_metadataTypeFile_image && !CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) && metadata.session == "" {
                 actions.append(
                     NCMenuAction(title: NSLocalizedString("_download_image_max_", comment: ""),
                         icon: CCGraphics.changeThemingColorImage(UIImage(named: "downloadImageFullRes"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
@@ -257,7 +256,6 @@ extension NCViewer {
                 )
             }
         }
-        */
         
         if metadata.typeFile == k_metadataTypeFile_image || metadata.typeFile == k_metadataTypeFile_video || metadata.typeFile == k_metadataTypeFile_audio {
             if let metadataLive = NCManageDatabase.sharedInstance.isLivePhoto(metadata: metadata) {

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

@@ -45,7 +45,7 @@ class NCViewerImagePageContainer: UIViewController, UIGestureRecognizerDelegate
     var nextIndex: Int?
    
     var startPanLocation = CGPoint.zero
-    let panDistanceForPopViewController: CGFloat = 100
+    let panDistanceForPopViewController: CGFloat = 150
     var defaultImageViewTopConstraint: CGFloat = 0
     var defaultImageViewBottomConstraint: CGFloat = 0
     
@@ -109,6 +109,19 @@ class NCViewerImagePageContainer: UIViewController, UIGestureRecognizerDelegate
     
     //MARK: - NotificationCenter
 
+    @objc func downloadedFile(_ notification: NSNotification) {
+        if self.view?.window == nil { return }
+        
+        if let userInfo = notification.userInfo as NSDictionary? {
+            if let metadata = userInfo["metadata"] as? tableMetadata, let errorCode = userInfo["errorCode"] as? Int {
+                if metadata.ocId == self.metadata.ocId && errorCode == 0 {
+                    
+                }
+                //progress(0)
+            }
+        }
+    }
+    
     @objc func changeTheming() {
         if currentMode == .normal {
             view.backgroundColor = NCBrandColor.sharedInstance.backgroundView