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

Fix .zoomable functionality in ImageViewerDialog and add "swipe up to close" #894

Conversation

sockenklaus
Copy link
Contributor

This closes #892

With my PR #738 I broke the intended functionality of com.jerboa.ui.components.common.ImageViewerDialog.kt.

The originally intended functionality was:

  • tap dialog to hide / show top icon bar
  • double tap to zoom in
  • double tap + drag to zoom in and out

My mistake:

I added a .clickable modifier to the image. This overwrote the indended functionality (...and added a white overlay according to @pipe01 which I honestly could not reproduce)

My solution in this PR:

I removed the .clickable modifier to restore the original functionality and also added the .scrollable modifier to the surrounding box. The box now listens to a scroll gesture and dismisses the dialog if it detects a scroll with a delta < -70. This translates to a "quickly swipe up" gesture.

Copy link
Collaborator

@MV-GH MV-GH left a comment

Choose a reason for hiding this comment

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

Looks good and works well

@twizmwazin twizmwazin merged commit 2e3d665 into LemmyNet:main Jun 28, 2023
1 check passed
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.

ImageViewerDialog: Functionality of .zoomable modifier broken
3 participants