thunder-app/thunder

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

Closed this issue · 3 comments

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

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.

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

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.