From 9ae33ea9cc40e342479b05e1c0a4e30a3157e6b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Paczos?= Date: Tue, 28 Apr 2020 15:28:30 +0200 Subject: [PATCH] notify about a fling only when it actually executes This makes sure that we need to meet all of the thresholds and actually start the fling camera animation before dispatching the onFLing event. Previously, it would be dispatched as soon as the compat detector fired. --- .../java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java b/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java index 3deed84cf..91e03b5f5 100644 --- a/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java +++ b/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java @@ -410,8 +410,6 @@ final class MapGestureDetector { return false; } - notifyOnFlingListeners(); - if (!uiSettings.isFlingVelocityAnimationEnabled()) { return false; } @@ -443,6 +441,7 @@ final class MapGestureDetector { } transform.cancelTransitions(); + notifyOnFlingListeners(); cameraChangeDispatcher.onCameraMoveStarted(REASON_API_GESTURE); // update transformation