Fix .zoomable functionality in ImageViewerDialog and add "swipe up to close" #894
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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.