Way to get location of tap outside view?

Open
#823 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
java
Domain
mobile

Research direction

Start with photoview/src/main/java/com/github/chrisbanes/photoview/OnOutsidePhotoTapListener.java and compare its callback with the onPhotoTap(ImageView, float, float) signature described in the issue. Trace where outside taps are dispatched, then update the callback behavior so it reports the requested clamped coordinates and verify the existing tap behavior remains intact.

Written by the indexing model from the issue text.

Description

I am looking at OnOutsidePhotoTapListener and void onOutsidePhotoTap(ImageView imageView);:

https://github.com/Baseflow/PhotoView/blob/master/photoview/src/main/java/com/github/chrisbanes/photoview/OnOutsidePhotoTapListener.java

🚀 Feature Requests

This callback appears to only say what ImageView the tap was outside of but not where it was.

Contextualize the feature / Describe the feature.

It would be useful to get, if not the exact location of the tap, the nearest point to the tap. As it is, if the user is trying to tap on a point on the edge of the photo view they might have to try several times accidentally tapping on the wrong side of the border.

Expected behavior, if this is possible: onOutsidePhotoTap should have the same signature as void onPhotoTap(ImageView view, float x, float y);. The coordinates returned should (probably) be clamped to the range 0..1, 0..1.

Dominant language
Java
Stars
18.8k
Forks
3.9k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Baseflow/PhotoView

All issues in Baseflow/PhotoView

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.