Browse Source

improved

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 1 year ago
parent
commit
10def16967
1 changed files with 10 additions and 13 deletions
  1. 10 13
      iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift

+ 10 - 13
iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift

@@ -408,23 +408,20 @@ class NCViewerPDF: UIViewController, NCViewerPDFSearchDelegate {
 
     @objc func tapPdfView(_ recognizer: UITapGestureRecognizer) {
 
-        pdfThumbnailScrollViewTopAnchor?.isActive = false
+        if pdfThumbnailScrollView.isHidden {
 
-        if navigationController?.isNavigationBarHidden ?? false {
-            navigationController?.setNavigationBarHidden(false, animated: true)
-            hideStatusBar = false
-            pdfThumbnailScrollViewTopAnchor = pdfThumbnailScrollView.topAnchor.constraint(equalTo: pdfContainer.safeAreaLayoutGuide.topAnchor)
-
-        } else {
-            navigationController?.setNavigationBarHidden(true, animated: true)
-            hideStatusBar = true
-            pdfThumbnailScrollViewTopAnchor = pdfThumbnailScrollView.topAnchor.constraint(equalTo: pdfContainer.topAnchor)
+            if navigationController?.isNavigationBarHidden ?? false {
+                navigationController?.setNavigationBarHidden(false, animated: true)
+                hideStatusBar = false
+                pdfThumbnailScrollViewTopAnchor = pdfThumbnailScrollView.topAnchor.constraint(equalTo: pdfContainer.safeAreaLayoutGuide.topAnchor)
+            } else {
+                navigationController?.setNavigationBarHidden(true, animated: true)
+                hideStatusBar = true
+                pdfThumbnailScrollViewTopAnchor = pdfThumbnailScrollView.topAnchor.constraint(equalTo: pdfContainer.topAnchor)
+            }
         }
 
-        pdfThumbnailScrollViewTopAnchor?.isActive = true
-
         handlePageChange()
-
         closePdfThumbnail()
     }