Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[android] added areAllGesturesEnabled() method and test (#14022)
Browse files Browse the repository at this point in the history
  • Loading branch information
Langston Smith authored Mar 4, 2019
1 parent 7453840 commit 4bc56cc
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,18 @@ public void setAllGesturesEnabled(boolean enabled) {
setQuickZoomGesturesEnabled(enabled);
}

/**
* <p>
* Retrieves the current status of whether all gestures are enabled.
* </p>
*
* @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());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}

0 comments on commit 4bc56cc

Please sign in to comment.