summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorŁukasz Paczos <lukas.paczos@gmail.com>2019-03-29 13:11:09 +0100
committerŁukasz Paczos <lukas.paczos@gmail.com>2019-03-29 13:11:09 +0100
commit062add9409b220bc442ec461b99ba491e368f95b (patch)
tree3a464a71c989c18aef397a45f95f3ed1cc5b471b
parent4e335d0b050c6d5b94ae0d28cb4fd36b939ad84b (diff)
downloadqtlocation-mapboxgl-upstream/lp-quickzoom-movement-14227.tar.gz
[android] disable move gesture detector foreseeing the quickzoomupstream/lp-quickzoom-movement-14227
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java
index c9e6e633aa..70b0004391 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java
@@ -357,9 +357,16 @@ final class MapGestureDetector {
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;
}
@@ -496,8 +503,6 @@ final class MapGestureDetector {
if (!uiSettings.isQuickZoomGesturesEnabled()) {
return false;
}
- // when quickzoom, disable move gesture
- gesturesManager.getMoveGestureDetector().setEnabled(false);
}
cancelTransitionsIfRequired();
@@ -538,11 +543,6 @@ final class MapGestureDetector {
@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(