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

Trying to move an image immediately after zooming with pinch-to-zoom causes more zooming. #1164

Open
Glazed opened this issue Mar 4, 2024 · 3 comments
Labels
bug Something isn't working fixed in upcoming release Indicates that an issue has been fixed, and will be released in the next version
Milestone

Comments

@Glazed
Copy link

Glazed commented Mar 4, 2024

Bug Description

Android has a single-finger zoom feature that I think is being invoked by accident in Thunder. To do it intentionally, you tap (and release) then immediately tap and hold. It's a double-tap where you hold the second tap. Then while holding, you can move your finger up and down to zoom.

In Thunder, if you pinch to zoom, release, then immediately tap and hold, it starts doing a single-finger zoom instead of letting you pan around the zoomed-in image.

It doesn't matter how long you hold down your finger and thumb for the pinch to zoom or whether you zoom in or out. After releasing there is a small window of time where performing a tap and hold will cause a single-finger zoom. If you wait a second it will let you pan around the image as expected, but I'm so used to being able to immediately use one finger to move around that I'm constantly invoking this bug.

It doesn't happen in any image viewer I've ever used, nor other Lemmy apps. (For example: Fossify Gallery, Sync for Lemmy, or even Firefox.) In those apps, you can tap and hold to pan around immediately after releasing your finger and thumb from zooming.

Expected Behaviour

It should let me move around the image with one finger immediately after releasing my finger and thumb.

Steps to Reproduce

  1. Open an image by tapping the thumbnail.
  2. Pinch to zoom into or out of the image for as long as you want.
  3. Immediately after releasing both fingers, tap and hold with a single finger to try to move the image around.

It's hard to judge how fast "immediately" is, but the interval during which this bug presents itself is long enough that I do it all the time. It's at least 1/10 of a second.

Additional Context

No response

App Version

v0.2.9

Device

Pixel 7 Pro

OS

Android 14

@Glazed Glazed added the bug Something isn't working label Mar 4, 2024
@hjiangsu
Copy link
Member

hjiangsu commented Mar 4, 2024

Thanks for the report! Just for some context, the double tap zoom gesture was implemented manually as there was no existing library that added in that capability. As it turns out, implementing custom gestures is not very trivial due to all other existing gestures, and conflicts between them.

@Glazed
Copy link
Author

Glazed commented Mar 4, 2024

Yeah, I figured that was the case. Perhaps take a look at how Fossify Gallery handles it. I dunno.

@CTalvio
Copy link
Collaborator

CTalvio commented Apr 29, 2024

Fix for this, incoming.

The fossify apps are android native and written in Kotlin. Thunder is built using flutter, which uses dart and is a multi-platform framework with a complex built-in gesture handling system that comes with it's own unique quirks and limitations, so unfortunately there is nothing to learn from fossify gallery that is applicable.

As doubletap-pan isn't a gesture type implemented in the flutter framework, I've been piecing it together from it's various other event handlers, which is totally doable, just comes with having to figure out all pitfalls to have this new gesture detected when its intended, and not detected when its unintended.

@hjiangsu hjiangsu added the fixed in upcoming release Indicates that an issue has been fixed, and will be released in the next version label May 11, 2024
@hjiangsu hjiangsu added this to the 0.4.0 milestone May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in upcoming release Indicates that an issue has been fixed, and will be released in the next version
Projects
None yet
Development

No branches or pull requests

3 participants