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
TIMOB-11845-Capture longpress using dispatchTouchEvent in native MapView #3871
Conversation
@@ -125,6 +133,54 @@ public boolean dispatchTouchEvent(MotionEvent ev) | |||
if (!scrollEnabled && ev.getAction() == MotionEvent.ACTION_MOVE) { | |||
return true; | |||
} | |||
int actionType = ev.getAction(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems it's more appropriate to put this implementation in onTouchEvent() instead of dispatchTouchEvent() since it's trying to handle events.
Should include a doc update if we're adding support on a new platform. Here are the changes that need to be made in apidoc/Titanium/Map/View.yml
That's all you need--the remaining docs will be inherited from View.longpress. |
float yhigh = longClickYCoordinate + Y_TOLERANCE; | ||
if ((xup > xlow && xup < xhigh) && (yup > ylow && yup < yhigh)) { | ||
// Treat it as a long press | ||
if (proxy.hierarchyHasListener(TiC.EVENT_LONGPRESS)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can move this check to the top. If there is no listener for longpress, we don't need to do such calculation.
Code reviewed. Looks good. Only one minor comment. |
Code reviewed and functionally tested. Also ran docgen.py and it passed. Request Accepted |
TIMOB-11845-Capture longpress using dispatchTouchEvent in native MapView
TIMOB-11845-Implemented the logic to detect LongPress based on touch.