diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/UiSettings.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/UiSettings.java index 3e24b8c797b..034dc63c350 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/UiSettings.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/UiSettings.java @@ -939,6 +939,18 @@ public void setAllGesturesEnabled(boolean enabled) { setQuickZoomGesturesEnabled(enabled); } + /** + *
+ * Retrieves the current status of whether all gestures are enabled. + *
+ * + * @return If true, all gestures are enabled. + */ + public boolean areAllGesturesEnabled() { + return rotateGesturesEnabled && tiltGesturesEnabled && zoomGesturesEnabled + && scrollGesturesEnabled && doubleTapGesturesEnabled && quickZoomGesturesEnabled; + } + private void saveFocalPoint(Bundle outState) { outState.putParcelable(MapboxConstants.STATE_USER_FOCAL_POINT, getFocalPoint()); } diff --git a/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/maps/UiSettingsTest.java b/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/maps/UiSettingsTest.java index b53c4692d92..79dcd5bc6c5 100644 --- a/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/maps/UiSettingsTest.java +++ b/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/maps/UiSettingsTest.java @@ -384,4 +384,19 @@ public void testAllGesturesDisabled() { assertEquals("Zoom gesture should be disabled", false, uiSettings.isZoomGesturesEnabled()); assertEquals("Scroll gesture should be disabled", false, uiSettings.isScrollGesturesEnabled()); } + + @Test + public void testAreAllGesturesEnabled() { + uiSettings.setAllGesturesEnabled(true); + assertEquals("All gestures check should return true", true, + uiSettings.areAllGesturesEnabled()); + } + + @Test + public void testAreAllGesturesEnabledWithOneGestureDisabled() { + uiSettings.setAllGesturesEnabled(true); + uiSettings.setScrollGesturesEnabled(false); + assertEquals("All gestures check should return false", false, + uiSettings.areAllGesturesEnabled()); + } }