From cea7cb24af132cfcb1c4470aa90ec4ed65cac00c Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Thu, 10 Sep 2020 15:38:06 +0300 Subject: [PATCH] Hide scrubber in media preview --- submodules/GalleryUI/Sources/GalleryController.swift | 1 + submodules/GalleryUI/Sources/GalleryItemNode.swift | 3 +++ .../GalleryUI/Sources/Items/UniversalVideoGalleryItem.swift | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/submodules/GalleryUI/Sources/GalleryController.swift b/submodules/GalleryUI/Sources/GalleryController.swift index a961a3decd..c785e51ba3 100644 --- a/submodules/GalleryUI/Sources/GalleryController.swift +++ b/submodules/GalleryUI/Sources/GalleryController.swift @@ -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) } diff --git a/submodules/GalleryUI/Sources/GalleryItemNode.swift b/submodules/GalleryUI/Sources/GalleryItemNode.swift index ebd39a13fe..7f90361440 100644 --- a/submodules/GalleryUI/Sources/GalleryItemNode.swift +++ b/submodules/GalleryUI/Sources/GalleryItemNode.swift @@ -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) { } diff --git a/submodules/GalleryUI/Sources/Items/UniversalVideoGalleryItem.swift b/submodules/GalleryUI/Sources/Items/UniversalVideoGalleryItem.swift index 79e7102a83..f5e21124f7 100644 --- a/submodules/GalleryUI/Sources/Items/UniversalVideoGalleryItem.swift +++ b/submodules/GalleryUI/Sources/Items/UniversalVideoGalleryItem.swift @@ -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)) }