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

Commit

Permalink
[android] disable move gesture detector foreseeing the quickzoom
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasPaczos authored and Łukasz Paczos committed Apr 1, 2019
1 parent 4731f88 commit 9a792ca
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,16 @@ public boolean onDoubleTapEvent(MotionEvent motionEvent) {
int action = motionEvent.getActionMasked();
if (action == MotionEvent.ACTION_DOWN) {
executeDoubleTap = true;

// disable the move detector in preparation for the quickzoom,
// so that we don't move the map's center slightly before the quickzoom is started (see #14227)
gesturesManager.getMoveGestureDetector().setEnabled(false);
}

if (motionEvent.getActionMasked() == MotionEvent.ACTION_UP) {
// re-enabled the move detector
gesturesManager.getMoveGestureDetector().setEnabled(true);

if (!uiSettings.isZoomGesturesEnabled() || !uiSettings.isDoubleTapGesturesEnabled() || !executeDoubleTap) {
return false;
}
Expand Down Expand Up @@ -496,8 +503,6 @@ public boolean onScaleBegin(@NonNull StandardScaleGestureDetector detector) {
if (!uiSettings.isQuickZoomGesturesEnabled()) {
return false;
}
// when quickzoom, disable move gesture
gesturesManager.getMoveGestureDetector().setEnabled(false);
}

cancelTransitionsIfRequired();
Expand Down Expand Up @@ -538,11 +543,6 @@ public boolean onScale(@NonNull StandardScaleGestureDetector detector) {

@Override
public void onScaleEnd(@NonNull StandardScaleGestureDetector detector, float velocityX, float velocityY) {
if (quickZoom) {
//if quickzoom, re-enabling move gesture detector
gesturesManager.getMoveGestureDetector().setEnabled(true);
}

if (uiSettings.isIncreaseRotateThresholdWhenScaling()) {
// resetting default angle threshold
gesturesManager.getRotateGestureDetector().setAngleThreshold(
Expand Down

0 comments on commit 9a792ca

Please sign in to comment.