meliorence / meliorence/react-native-image-gallery
Better support for tap and longPress
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 717
- Forks
- 298
- PR merge metrics
- No merged PRs in 30d
Description
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?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/Gallery.js around the hardcoded 600ms long-press delay, then inspect onSingleTapConfirmed in react-native-gesture-responder's library/createResponder.js. Define how configurable single-press and long-press delays should interact, implement the requested defaults, and verify that tap and long-press image interactions can be distinguished.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react-native
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100