Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//

Check failure on line 1 in Signal/src/ViewControllers/MediaGallery/MediaItemViewController.swift

View workflow job for this annotation

GitHub Actions / Lint

Incorrectly formatted (Scripts/precommit.py)
// Copyright 2023 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
//
Expand All @@ -9,9 +9,9 @@
import YYImage

protocol MediaItemViewControllerDelegate: AnyObject {

func mediaItemViewControllerDidTapMedia(_ viewController: MediaItemViewController)
func mediaItemViewControllerWillBeginZooming(_ viewController: MediaItemViewController)
func mediaItemViewControllerFullyZoomedOut(_ viewController: MediaItemViewController)
}

protocol VideoPlaybackStatusProvider: AnyObject {
Expand Down Expand Up @@ -403,6 +403,13 @@
delegate?.mediaItemViewControllerWillBeginZooming(self)
}

//This is called at the end of whenever we zoom in, or zoom out. "Zooming" in this context means both zooming in and out.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this comment isn't adding much.

func scrollViewDidEndZooming(_ scrollView: UIScrollView, with view: UIView?, atScale scale: CGFloat) {
if scale <= scrollView.minimumZoomScale {
delegate?.mediaItemViewControllerFullyZoomedOut(self)
}
}

func scrollViewDidZoom(_ scrollView: UIScrollView) {
updateZoomScaleAndConstraints()
view.layoutIfNeeded()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//

Check failure on line 1 in Signal/src/ViewControllers/MediaGallery/MediaPageViewController.swift

View workflow job for this annotation

GitHub Actions / Lint

Incorrectly formatted (Scripts/precommit.py)
// Copyright 2018 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
//
Expand Down Expand Up @@ -725,14 +725,18 @@
}

extension MediaPageViewController: MediaItemViewControllerDelegate {

func mediaItemViewControllerDidTapMedia(_ viewController: MediaItemViewController) {
setShouldHideToolbars(!shouldHideToolbars, animated: true)
}

func mediaItemViewControllerWillBeginZooming(_ viewController: MediaItemViewController) {
setShouldHideToolbars(true, animated: true)
}

func mediaItemViewControllerFullyZoomedOut(_ viewController: MediaItemViewController) {
setShouldHideToolbars(false, animated: true)
}
}

extension MediaGalleryItem: GalleryRailItem {
Expand Down
Loading