|
@@ -485,35 +485,39 @@ extension NCViewerMedia {
|
|
|
private func openDetail(animate: Bool = true) {
|
|
|
delegate?.didOpenDetail()
|
|
|
self.dismissTip()
|
|
|
-
|
|
|
- self.scrollView.setZoomScale(1.0, animated: false)
|
|
|
|
|
|
- statusLabel.isHidden = true
|
|
|
- statusViewImage.isHidden = true
|
|
|
+ UIView.animate(withDuration: 0.3) {
|
|
|
+ self.scrollView.setZoomScale(1.0, animated: false)
|
|
|
|
|
|
- NCUtility.shared.getExif(metadata: metadata) { exif in
|
|
|
- self.view.layoutIfNeeded()
|
|
|
- self.showDetailView(exif: exif)
|
|
|
-
|
|
|
- if let image = self.imageVideoContainer.image {
|
|
|
- let ratioW = self.imageVideoContainer.frame.width / image.size.width
|
|
|
- let ratioH = self.imageVideoContainer.frame.height / image.size.height
|
|
|
- let ratio = min(ratioW, ratioH)
|
|
|
- let imageHeight = image.size.height * ratio
|
|
|
- let imageContainerHeight = self.imageVideoContainer.frame.height * ratio
|
|
|
- let height = max(imageHeight, imageContainerHeight)
|
|
|
- self.imageViewConstraint = self.detailView.frame.height - ((self.view.frame.height - height) / 2) + self.view.safeAreaInsets.bottom
|
|
|
- if self.imageViewConstraint < 0 { self.imageViewConstraint = 0 }
|
|
|
- }
|
|
|
+ self.statusLabel.isHidden = true
|
|
|
+ self.statusViewImage.isHidden = true
|
|
|
|
|
|
- UIView.animate(withDuration: animate ? 0.3 : 0) {
|
|
|
- self.imageViewTopConstraint.constant = -self.imageViewConstraint
|
|
|
- self.imageViewBottomConstraint.constant = self.imageViewConstraint
|
|
|
- self.detailViewTopConstraint.constant = self.detailView.frame.height
|
|
|
+ NCUtility.shared.getExif(metadata: self.metadata) { exif in
|
|
|
self.view.layoutIfNeeded()
|
|
|
+ self.showDetailView(exif: exif)
|
|
|
+
|
|
|
+ if let image = self.imageVideoContainer.image {
|
|
|
+ let ratioW = self.imageVideoContainer.frame.width / image.size.width
|
|
|
+ let ratioH = self.imageVideoContainer.frame.height / image.size.height
|
|
|
+ let ratio = min(ratioW, ratioH)
|
|
|
+ let imageHeight = image.size.height * ratio
|
|
|
+ let imageContainerHeight = self.imageVideoContainer.frame.height * ratio
|
|
|
+ let height = max(imageHeight, imageContainerHeight)
|
|
|
+ self.imageViewConstraint = self.detailView.frame.height - ((self.view.frame.height - height) / 2) + self.view.safeAreaInsets.bottom
|
|
|
+ if self.imageViewConstraint < 0 { self.imageViewConstraint = 0 }
|
|
|
+ }
|
|
|
+
|
|
|
+ UIView.animate(withDuration: animate ? 0.3 : 0) {
|
|
|
+ self.imageViewTopConstraint.constant = -self.imageViewConstraint
|
|
|
+ self.imageViewBottomConstraint.constant = self.imageViewConstraint
|
|
|
+ self.detailViewTopConstraint.constant = self.detailView.frame.height
|
|
|
+ self.view.layoutIfNeeded()
|
|
|
+ }
|
|
|
+
|
|
|
+ self.scrollView.pinchGestureRecognizer?.isEnabled = false
|
|
|
}
|
|
|
+ } completion: { _ in
|
|
|
|
|
|
- self.scrollView.pinchGestureRecognizer?.isEnabled = false
|
|
|
}
|
|
|
}
|
|
|
|