marinofaggiana 3 жил өмнө
parent
commit
11ec2c37d5

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

@@ -96,7 +96,7 @@
                                         <nil key="highlightedColor"/>
                                     </label>
                                     <view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="P8R-4f-zAl" customClass="NCViewerImageDetailView" customModule="Nextcloud" customModuleProvider="target">
-                                        <rect key="frame" x="0.0" y="336" width="414" height="375"/>
+                                        <rect key="frame" x="0.0" y="736" width="414" height="375"/>
                                         <subviews>
                                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="HRq-3M-yeb">
                                                 <rect key="frame" x="15" y="50" width="384" height="1"/>
@@ -346,7 +346,7 @@
                             <constraint firstItem="Yo6-7W-moG" firstAttribute="trailing" secondItem="sBp-t2-eFh" secondAttribute="trailing" constant="25" id="TCr-e0-gnG"/>
                             <constraint firstItem="2AU-85-K8y" firstAttribute="leading" secondItem="Yo6-7W-moG" secondAttribute="leading" constant="10" id="X10-OG-EKg"/>
                             <constraint firstItem="Yo6-7W-moG" firstAttribute="top" secondItem="2AU-85-K8y" secondAttribute="top" constant="-10" id="avO-83-uMQ"/>
-                            <constraint firstItem="Yo6-7W-moG" firstAttribute="bottom" secondItem="P8R-4f-zAl" secondAttribute="top" constant="400" id="bor-cg-Alz"/>
+                            <constraint firstItem="Yo6-7W-moG" firstAttribute="bottom" secondItem="P8R-4f-zAl" secondAttribute="top" id="bor-cg-Alz"/>
                             <constraint firstItem="P8R-4f-zAl" firstAttribute="leading" secondItem="Yo6-7W-moG" secondAttribute="leading" id="dly-i5-fPW"/>
                             <constraint firstItem="CdQ-LC-Trx" firstAttribute="leading" secondItem="fIE-H6-KKc" secondAttribute="leading" id="g8C-2m-KkX"/>
                             <constraint firstItem="CdQ-LC-Trx" firstAttribute="top" secondItem="fIE-H6-KKc" secondAttribute="top" id="hcQ-lB-JwU"/>

+ 7 - 19
iOSClient/Viewer/NCViewerImage/NCViewerImageZoom.swift

@@ -51,14 +51,8 @@ class NCViewerImageZoom: UIViewController {
     var index: Int = 0
     var minScale: CGFloat = 0
     var noPreview: Bool = false
-    
     var doubleTapGestureRecognizer: UITapGestureRecognizer = UITapGestureRecognizer()
                 
-//    private var startImageViewTopConstraint: CGFloat = 0
-//    private var startImageViewBottomConstraint: CGFloat = 0
-//    private var startPoint = CGPoint.zero
-//    private var topPoint = CGPoint.zero
-
     // MARK: - View Life Cycle
 
     required init?(coder aDecoder: NSCoder) {
@@ -103,6 +97,7 @@ class NCViewerImageZoom: UIViewController {
             heightMap = (view.bounds.width / 3)
         }
         
+        detailViewConstraint.constant = 0
         detailView.update(metadata: metadata, image: image, heightMap: heightMap)
         detailView.hide()
     }
@@ -161,10 +156,6 @@ class NCViewerImageZoom: UIViewController {
         case .began:
             print("began")
 
-            
-//            startPoint = CGPoint(x: currentLocation.x, y: currentLocation.y)
-//            topPoint = CGPoint(x: currentLocation.x, y: currentLocation.y)
-
         case .ended:
             
             print("end")
@@ -187,10 +178,7 @@ class NCViewerImageZoom: UIViewController {
             */
         
         case .changed:
-            
-//            if currentLocation.y < topPoint.y { topPoint = currentLocation }
-//            let deltaY = startPoint.y - currentLocation.y
-            
+                        
             imageViewTopConstraint.constant = currentLocation.y
             imageViewBottomConstraint.constant = -currentLocation.y
             detailViewConstraint.constant = currentLocation.y
@@ -202,17 +190,17 @@ class NCViewerImageZoom: UIViewController {
             }
 
             // OPEN DETAIL
-            if (imageView.center.y < view.center.y - 10) && detailView.isHidden {
+            if (imageView.center.y < view.center.y - 20) && detailView.isHidden {
                          
                 self.detailView.show(textColor: self.viewerImage?.textColor)
-
+                gestureRecognizer.state = .ended
+                
                 UIView.animate(withDuration: 0.3) {
                     self.imageViewTopConstraint.constant = -self.detailView.frame.height
                     self.imageViewBottomConstraint.constant = self.detailView.frame.height
-                    self.detailViewConstraint.constant = self.detailView.frame.height
-//                    self.view.layoutIfNeeded()
+                    self.detailViewConstraint.constant = 200
+                    self.view.layoutIfNeeded()
                 } completion: { (_) in
-                    gestureRecognizer.state = .ended
                 }
             }