diff options
author | tobrun <tobrun.van.nuland@gmail.com> | 2018-07-12 09:29:17 +0200 |
---|---|---|
committer | Tobrun <tobrun@mapbox.com> | 2018-07-12 10:46:40 +0200 |
commit | b79b971f56738753e79a5352a7b5d6bb8a889b22 (patch) | |
tree | 1e6bdf09c39d9ac42a98ce7cdf49adb9ee4106f6 | |
parent | bf69f1a2d3ed4e6792b5ebc704b9cb70c02e6f57 (diff) | |
download | qtlocation-mapboxgl-b79b971f56738753e79a5352a7b5d6bb8a889b22.tar.gz |
[android] - validate if gesture detector is able to handle gesture
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java index f4b1bca251..57f8c61f7e 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java @@ -427,7 +427,7 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { @Override public boolean onTouchEvent(MotionEvent event) { - if (!isMapInitialized() || !isZoomButtonControllerInitialized()) { + if (!isMapInitialized() || !isZoomButtonControllerInitialized() || !isGestureDetectorInitialized()) { return super.onTouchEvent(event); } @@ -459,7 +459,7 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { @Override public boolean onGenericMotionEvent(MotionEvent event) { - if (mapGestureDetector == null) { + if (!isGestureDetectorInitialized()) { return super.onGenericMotionEvent(event); } return mapGestureDetector.onGenericMotionEvent(event) || super.onGenericMotionEvent(event); @@ -676,6 +676,10 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { return mapZoomButtonController != null; } + private boolean isGestureDetectorInitialized() { + return mapGestureDetector != null; + } + MapboxMap getMapboxMap() { return mapboxMap; } |