Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[android] - validate if gestures should execute (#9173)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobrun authored Jun 2, 2017
1 parent 3b837d9 commit da53200
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,14 @@ public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float ve
// Called for drags
@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
if (!trackingSettings.isScrollGestureCurrentlyEnabled()) {
return false;
}

if (dragStarted) {
return false;
}

if (!scrollInProgress) {
scrollInProgress = true;

Expand All @@ -393,13 +401,6 @@ public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float d
getLocationFromGesture(e1.getX(), e1.getY()),
MapboxEvent.GESTURE_PAN_START, transform));
}
if (!trackingSettings.isScrollGestureCurrentlyEnabled()) {
return false;
}

if (dragStarted) {
return false;
}

// reset tracking if needed
trackingSettings.resetTrackingModesIfRequired(true, false, false);
Expand Down

0 comments on commit da53200

Please sign in to comment.