diff options
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/UiSettings.java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/UiSettings.java | 29 |
1 files changed, 29 insertions, 0 deletions
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 49abb70c91..4c4ced8804 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 @@ -67,6 +67,7 @@ public final class UiSettings { private boolean flingVelocityAnimationEnabled = true; private boolean increaseRotateThresholdWhenScaling = true; + private boolean disableRotateWhenScaling = true; private boolean increaseScaleThresholdWhenRotating = true; private float zoomRate = 1.0f; @@ -132,6 +133,7 @@ public final class UiSettings { outState.putBoolean(MapboxConstants.STATE_ROTATE_ANIMATION_ENABLED, isRotateVelocityAnimationEnabled()); outState.putBoolean(MapboxConstants.STATE_FLING_ANIMATION_ENABLED, isFlingVelocityAnimationEnabled()); outState.putBoolean(MapboxConstants.STATE_INCREASE_ROTATE_THRESHOLD, isIncreaseRotateThresholdWhenScaling()); + outState.putBoolean(MapboxConstants.STATE_DISABLE_ROTATE_WHEN_SCALING, isDisableRotateWhenScaling()); outState.putBoolean(MapboxConstants.STATE_INCREASE_SCALE_THRESHOLD, isIncreaseScaleThresholdWhenRotating()); outState.putBoolean(MapboxConstants.STATE_QUICK_ZOOM_ENABLED, isQuickZoomGesturesEnabled()); outState.putFloat(MapboxConstants.STATE_ZOOM_RATE, getZoomRate()); @@ -148,6 +150,7 @@ public final class UiSettings { setFlingVelocityAnimationEnabled(savedInstanceState.getBoolean(MapboxConstants.STATE_FLING_ANIMATION_ENABLED)); setIncreaseRotateThresholdWhenScaling( savedInstanceState.getBoolean(MapboxConstants.STATE_INCREASE_ROTATE_THRESHOLD)); + setDisableRotateWhenScaling(savedInstanceState.getBoolean(MapboxConstants.STATE_DISABLE_ROTATE_WHEN_SCALING)); setIncreaseScaleThresholdWhenRotating( savedInstanceState.getBoolean(MapboxConstants.STATE_INCREASE_SCALE_THRESHOLD)); setQuickZoomGesturesEnabled(savedInstanceState.getBoolean(MapboxConstants.STATE_QUICK_ZOOM_ENABLED)); @@ -919,7 +922,9 @@ public final class UiSettings { * Returns whether rotation threshold should be increase whenever scale is detected. * * @return If true, rotation threshold will be increased. + * @deprecated unused, see {@link #isDisableRotateWhenScaling()} instead */ + @Deprecated public boolean isIncreaseRotateThresholdWhenScaling() { return increaseRotateThresholdWhenScaling; } @@ -928,16 +933,38 @@ public final class UiSettings { * Set whether rotation threshold should be increase whenever scale is detected. * * @param increaseRotateThresholdWhenScaling If true, rotation threshold will be increased. + * @deprecated unused, see {@link #setDisableRotateWhenScaling(boolean)} instead */ + @Deprecated public void setIncreaseRotateThresholdWhenScaling(boolean increaseRotateThresholdWhenScaling) { this.increaseRotateThresholdWhenScaling = increaseRotateThresholdWhenScaling; } /** + * Returns whether rotation gesture detector is disabled when scale is detected first. + * + * @return If true, rotation gesture detector will be disabled when scale is detected first. + */ + public boolean isDisableRotateWhenScaling() { + return disableRotateWhenScaling; + } + + /** + * Set whether rotation gesture detector should be disabled when scale is detected first. + * + * @param disableRotateWhenScaling If true, rotation gesture detector will be disabled when scale is detected first. + */ + public void setDisableRotateWhenScaling(boolean disableRotateWhenScaling) { + this.disableRotateWhenScaling = disableRotateWhenScaling; + } + + /** * Returns whether scale threshold should be increase whenever rotation is detected. * * @return If true, scale threshold will be increased. + * @deprecated unused */ + @Deprecated public boolean isIncreaseScaleThresholdWhenRotating() { return increaseScaleThresholdWhenRotating; } @@ -946,7 +973,9 @@ public final class UiSettings { * set whether scale threshold should be increase whenever rotation is detected. * * @param increaseScaleThresholdWhenRotating If true, scale threshold will be increased. + * @deprecated unused */ + @Deprecated public void setIncreaseScaleThresholdWhenRotating(boolean increaseScaleThresholdWhenRotating) { this.increaseScaleThresholdWhenRotating = increaseScaleThresholdWhenRotating; } |