diff options
author | Tobrun <tobrun@mapbox.com> | 2017-06-06 12:13:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-06 12:13:56 +0200 |
commit | ef7b3552b52002c153a0b93a87d27f8b5d378f4f (patch) | |
tree | 1dcb62e0ee3f08582a3576337433b530b6328439 /platform | |
parent | da532007043b1827e83686faca0de2a45c4ef730 (diff) | |
download | qtlocation-mapboxgl-ef7b3552b52002c153a0b93a87d27f8b5d378f4f.tar.gz |
[android] - only invoke callback if fling scrolling animation isn't going to be ignored. (#9192)
Diffstat (limited to 'platform')
2 files changed, 5 insertions, 5 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 33e13c5ecc..5346baa4e2 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 @@ -346,7 +346,6 @@ final class MapGestureDetector { // and ignore when a scale gesture has occurred return false; } - cameraChangeDispatcher.onCameraMoveStarted(REASON_API_GESTURE); float screenDensity = uiSettings.getPixelRatio(); @@ -362,6 +361,8 @@ final class MapGestureDetector { // cancel any animation transform.cancelTransitions(); + cameraChangeDispatcher.onCameraMoveStarted(REASON_API_GESTURE); + // tilt results in a bigger translation, limiting input for #5281 double tilt = transform.getTilt(); double tiltFactor = 1 + ((tilt != 0) ? (tilt / 10) : 0); /* 1 -> 7 */ diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java index 7f44e0de07..9a8997014a 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java @@ -79,7 +79,7 @@ final class Transform implements MapView.OnMapChangedListener { @Override public void onMapChanged(@MapView.MapChange int change) { - if (change == REGION_DID_CHANGE_ANIMATED && cameraCancelableCallback != null) { + if (change == REGION_DID_CHANGE_ANIMATED) { updateCameraPosition(invalidateCameraPosition()); if (cameraCancelableCallback != null) { cameraCancelableCallback.onFinish(); @@ -116,8 +116,8 @@ final class Transform implements MapView.OnMapChangedListener { if (callback != null) { cameraCancelableCallback = callback; - mapView.addOnMapChangedListener(this); } + mapView.addOnMapChangedListener(this); mapView.easeTo(cameraPosition.bearing, cameraPosition.target, durationMs, cameraPosition.tilt, cameraPosition.zoom, easingInterpolator); } @@ -134,9 +134,8 @@ final class Transform implements MapView.OnMapChangedListener { if (callback != null) { cameraCancelableCallback = callback; - mapView.addOnMapChangedListener(this); } - + mapView.addOnMapChangedListener(this); mapView.flyTo(cameraPosition.bearing, cameraPosition.target, durationMs, cameraPosition.tilt, cameraPosition.zoom); } |