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

[android] Adding areAllGesturesEnabled() boolean retreival method to UiSettings class #14022

Merged
merged 1 commit into from
Mar 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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());
}
}