Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display images with new image viewer (ScrollView version) #1408

Closed
wants to merge 15 commits into from

Conversation

joshuatbrown
Copy link
Contributor

@joshuatbrown joshuatbrown commented Aug 16, 2024

Issues covered

#1164

Description

Displays full-screen images with the new image viewer. The gallery view will be covered in #1177.

How to test

  1. Navigate to a post with an image
  2. Tap on it
  3. You're in the new image viewer!
  4. Double-tap to zoom in
  5. Drag around to pan
  6. Double-tap again to zoom out
  7. Swipe down or tap the x to dismiss

Screenshots/Video

Coming soon!

Notes

#1408 and #1413 are the same thing, but using different implementations. The point of having three draft PRs is to decide on the right approach -- each has its own pros and cons.

Pros for this approach

  1. This is the simplest implementation by far.
  2. It's pure SwiftUI.
  3. Works as expected on Mac. You can swipe on a mouse or trackpad, or click and drag.

Cons for this approach

  1. Swipe down to dismiss currently isn't implemented. It probably can be, though I haven't had any luck yet.
  2. Pinching to zoom isn't implemented here. It's not a requirement right now, but if it is in the future, this approach may not work as well as the others.
  3. Double-tapping to zoom will zoom in on the middle of the image, even if you double-tap the top left or bottom right corner. It doesn't zoom where you tapped.
  4. On a portrait image, if you double-tap to zoom, you can scroll past the top or bottom of the image. Here's an example:

IMG_F5BE605328FD-1

@joshuatbrown joshuatbrown changed the title Display images with new image viewer (DragGesture version) Display images with new image viewer (ScrollView version) Aug 16, 2024
@joshuatbrown joshuatbrown marked this pull request as ready for review August 16, 2024 16:09
# Conflicts:
#	Nos/Views/Components/Images/ImageViewer.swift
#	Nos/Views/LinkPreview.swift
@joshuatbrown
Copy link
Contributor Author

We're moving forward with #1413.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant