Hide scrubber in media preview

This commit is contained in:
Ilya Laktyushin 2020-09-10 15:38:06 +03:00
parent ae38464d11
commit cea7cb24af
3 changed files with 10 additions and 0 deletions

View File

@ -1225,6 +1225,7 @@ public class GalleryController: ViewController, StandalonePresentableController
self.adjustedForInitialPreviewingLayout = true
self.galleryNode.setControlsHidden(true, animated: false)
if let centralItemNode = self.galleryNode.pager.centralItemNode(), let itemSize = centralItemNode.contentSize() {
centralItemNode.adjustForPreviewing()
self.preferredContentSize = itemSize.aspectFitted(layout.size)
self.containerLayoutUpdated(ContainerViewLayout(size: self.preferredContentSize, metrics: LayoutMetrics(), deviceMetrics: layout.deviceMetrics, intrinsicInsets: UIEdgeInsets(), safeInsets: UIEdgeInsets(), statusBarHeight: nil, inputHeight: nil, inputHeightIsInteractivellyChanging: false, inVoiceOver: false), transition: .immediate)
}

View File

@ -85,6 +85,9 @@ open class GalleryItemNode: ASDisplayNode {
open func controlsVisibilityUpdated(isVisible: Bool) {
}
open func adjustForPreviewing() {
}
open func animateIn(from node: (ASDisplayNode, CGRect, () -> (UIView?, UIView?)), addToTransitionSurface: (UIView) -> Void, completion: @escaping () -> Void) {
}

View File

@ -1537,6 +1537,12 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
}
}
override func adjustForPreviewing() {
super.adjustForPreviewing()
self.scrubberView.isHidden = true
}
override func footerContent() -> Signal<(GalleryFooterContentNode?, GalleryOverlayContentNode?), NoError> {
return .single((self.footerContentNode, nil))
}