diff options
author | marinofaggiana <ios@nextcloud.com> | 2022-04-30 13:49:48 +0300 |
---|---|---|
committer | marinofaggiana <ios@nextcloud.com> | 2022-04-30 13:49:48 +0300 |
commit | c7bbe7b433ff6900b3d16d1515a6c4eb99c969bb (patch) | |
tree | d1e8fe78e7683eb5a49c685a210291517fb2bccd | |
parent | 3def6e153028046045c13c6d205fb43b80760bdf (diff) |
Improveds
Signed-off-by: marinofaggiana <ios@nextcloud.com>
-rw-r--r-- | iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift b/iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift index c72af9d07..355ba4b33 100644 --- a/iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift +++ b/iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift @@ -97,7 +97,7 @@ class NCViewerPDF: UIViewController, NCViewerPDFSearchDelegate, UIGestureRecogni view.addSubview(pdfThumbnailScrollView) NSLayoutConstraint.activate([ - pdfThumbnailScrollView.topAnchor.constraint(equalTo: view.topAnchor), + pdfThumbnailScrollView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor), pdfThumbnailScrollView.bottomAnchor.constraint(equalTo: view.bottomAnchor) ]) pdfThumbnailScrollViewleadingAnchor = pdfThumbnailScrollView.leadingAnchor.constraint(equalTo: view.leadingAnchor) @@ -342,9 +342,9 @@ class NCViewerPDF: UIViewController, NCViewerPDFSearchDelegate, UIGestureRecogni @objc func tapPdfView(_ recognizer: UITapGestureRecognizer) { if navigationController?.isNavigationBarHidden ?? false { - navigationController?.setNavigationBarHidden(false, animated: false) + navigationController?.setNavigationBarHidden(false, animated: true) } else { - navigationController?.setNavigationBarHidden(true, animated: false) + navigationController?.setNavigationBarHidden(true, animated: true) } } @@ -427,15 +427,7 @@ class NCViewerPDF: UIViewController, NCViewerPDFSearchDelegate, UIGestureRecogni let endY = visibleRect.origin.y + visibleRect.height + thumbnailViewHeight if currentPageY < startY { - if gotoY < 0 { - let safeAreaInsetsTop = UIApplication.shared.keyWindow?.safeAreaInsets.top ?? 0 - let statusBarFrameHeight = UIApplication.shared.statusBarFrame.height - if navigationController?.isNavigationBarHidden ?? true { - gotoY = -statusBarFrameHeight - } else { - gotoY = safeAreaInsetsTop == 0 ? -statusBarFrameHeight : -(safeAreaInsetsTop + statusBarFrameHeight) - } - } + if gotoY < 0 { gotoY = 0 } pdfThumbnailScrollView.setContentOffset(CGPoint(x: 0, y: gotoY), animated: true) } else if currentPageY > endY { if gotoY > pdfThumbnailView.frame.height - visibleRect.height { |