react-native-image-gallery icon indicating copy to clipboard operation
react-native-image-gallery copied to clipboard

Better support for tap and longPress

Open slorber opened this issue 7 years ago • 3 comments

Currently it's hard to use tap and long press events on the images.

I want to use in the same time:

  • tap (fast press) to show/hide photo infos
  • long press to select the photo

Long press delay is hardcoded to 600ms here: https://github.com/archriss/react-native-image-gallery/blob/master/src/Gallery.js#L133

onSingleTapConfirmed is more suited to ensure that it is a singleTap (vs a double tap) but is slow to fire and has a 500ms delay: https://github.com/ldn0x7dc/react-native-gesture-responder/blob/master/library/createResponder.js#L220

It would be nice to make these 2 delays configurable so that it's easy to detect a single press / long press. The most annoying is to have the delay on single press. Could we have something like onPress, similar to the longpress code, but with a much shorter default delay (like 150) and make both delays configurable?

slorber avatar Jan 04 '18 15:01 slorber

I second that. In our application, we need single tap detection without delay. And we don't need the double tap zoom, since users can use pinch to zoom.

It would be wonderful if an option can be provided to disable double tap zoom so that the single tap detection can be done without delay.

howg0924 avatar Mar 22 '18 05:03 howg0924

Yeah I really need this too. onSingleTapConfirmed is unusable for my purpose right now. Have either of you modified the code yourselves?

creeve avatar Jun 08 '18 04:06 creeve

+1

wxsms avatar May 09 '19 11:05 wxsms