public final class UiSettings
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
AttributionDialogManager |
getAttributionDialogManager()
Get the custom attribution dialog manager.
|
int |
getAttributionGravity()
Returns the gravity value of the logo
|
int |
getAttributionMarginBottom()
Returns the bottom side margin of the logo
|
int |
getAttributionMarginLeft()
Returns the left side margin of the attribution view.
|
int |
getAttributionMarginRight()
Returns the right side margin of the attribution view.
|
int |
getAttributionMarginTop()
Returns the top side margin of the attribution view.
|
int |
getCompassGravity()
Returns the gravity value of the CompassView
|
android.graphics.drawable.Drawable |
getCompassImage()
Get the current configured CompassView image.
|
int |
getCompassMarginBottom()
Returns the bottom side margin of CompassView
|
int |
getCompassMarginLeft()
Returns the left side margin of CompassView
|
int |
getCompassMarginRight()
Returns the right side margin of CompassView
|
int |
getCompassMarginTop()
Returns the top side margin of CompassView
|
android.graphics.PointF |
getFocalPoint()
Returns the gesture focal point
|
float |
getHeight()
Returns the measured height of the MapView
|
int |
getLogoGravity()
Returns the gravity value of the logo
|
int |
getLogoMarginBottom()
Returns the bottom side margin of the logo
|
int |
getLogoMarginLeft()
Returns the left side margin of the logo
|
int |
getLogoMarginRight()
Returns the right side margin of the logo
|
int |
getLogoMarginTop()
Returns the top side margin of the logo
|
float |
getWidth()
Returns the measured width of the MapView
|
void |
invalidate()
Invalidates the ViewSettings instances shown on top of the MapView
|
boolean |
isAttributionEnabled()
Returns whether the attribution is enabled.
|
boolean |
isCompassEnabled()
Returns whether the compass is enabled.
|
boolean |
isCompassFadeWhenFacingNorth()
Returns whether the compass performs a fading animation out when facing north.
|
boolean |
isDeselectMarkersOnTap()
Gets whether the markers are automatically deselected (and therefore, their infowindows
closed) when a map tap is detected.
|
boolean |
isDoubleTapGesturesEnabled()
Returns whether the user may zoom the map with a double tap.
|
boolean |
isFlingVelocityAnimationEnabled()
Returns whether fling velocity animation should execute after users finishes a gesture.
|
boolean |
isIncreaseRotateThresholdWhenScaling()
Returns whether rotation threshold should be increase whenever scale is detected.
|
boolean |
isIncreaseScaleThresholdWhenRotating()
Returns whether scale threshold should be increase whenever rotation is detected.
|
boolean |
isLogoEnabled()
Returns whether the logo is enabled.
|
boolean |
isRotateGesturesEnabled()
Returns whether the user may rotate the map.
|
boolean |
isRotateVelocityAnimationEnabled()
Returns whether rotate velocity animation should execute after users finishes a gesture.
|
boolean |
isScaleVelocityAnimationEnabled()
Returns whether scale velocity animation should execute after users finishes a gesture.
|
boolean |
isScrollGesturesEnabled()
Returns whether the user may scroll around the map.
|
boolean |
isTiltGesturesEnabled()
Returns whether the user may tilt the map.
|
boolean |
isZoomControlsEnabled()
Gets whether the zoom controls are enabled.
|
boolean |
isZoomGesturesEnabled()
Returns whether the user may zoom the map.
|
void |
setAllGesturesEnabled(boolean enabled)
Sets the preference for whether all gestures should be enabled or disabled.
|
void |
setAllVelocityAnimationsEnabled(boolean allVelocityAnimationsEnabled)
Set whether all velocity animations should execute after users finishes a gesture.
|
void |
setAttributionDialogManager(AttributionDialogManager attributionDialogManager)
Set a custom attribution dialog manager.
|
void |
setAttributionEnabled(boolean enabled)
Enables or disables the attribution.
|
void |
setAttributionGravity(int gravity)
Sets the gravity of the attribution.
|
void |
setAttributionMargins(int left,
int top,
int right,
int bottom)
Sets the margins of the attribution view.
|
void |
setAttributionTintColor(int tintColor)
Sets the tint of the attribution view.
|
void |
setCompassEnabled(boolean compassEnabled)
Enables or disables the compass.
|
void |
setCompassFadeFacingNorth(boolean compassFadeFacingNorth)
Enables or disables fading of the compass when facing north.
|
void |
setCompassGravity(int gravity)
Sets the gravity of the compass view.
|
void |
setCompassImage(android.graphics.drawable.Drawable compass)
Specifies the CompassView image.
|
void |
setCompassMargins(int left,
int top,
int right,
int bottom)
Sets the margins of the compass view.
|
void |
setDeselectMarkersOnTap(boolean deselectMarkersOnTap)
Sets whether the markers are automatically deselected (and therefore, their infowindows
closed) when a map tap is detected.
|
void |
setDoubleTapGesturesEnabled(boolean doubleTapGesturesEnabled)
Changes whether the user may zoom the map with a double tap.
|
void |
setFlingVelocityAnimationEnabled(boolean flingVelocityAnimationEnabled)
Set whether fling velocity animation should execute after users finishes a gesture.
|
void |
setFocalPoint(android.graphics.PointF focalPoint)
Sets the focal point used as center for a gesture
|
void |
setIncreaseRotateThresholdWhenScaling(boolean increaseRotateThresholdWhenScaling)
Set whether rotation threshold should be increase whenever scale is detected.
|
void |
setIncreaseScaleThresholdWhenRotating(boolean increaseScaleThresholdWhenRotating)
set whether scale threshold should be increase whenever rotation is detected.
|
void |
setLogoEnabled(boolean enabled)
Enables or disables the Mapbox logo.
|
void |
setLogoGravity(int gravity)
Sets the gravity of the logo view.
|
void |
setLogoMargins(int left,
int top,
int right,
int bottom)
Sets the margins of the logo view.
|
void |
setRotateGesturesEnabled(boolean rotateGesturesEnabled)
Changes whether the user may rotate the map.
|
void |
setRotateVelocityAnimationEnabled(boolean rotateVelocityAnimationEnabled)
Set whether rotate velocity animation should execute after users finishes a gesture.
|
void |
setScaleVelocityAnimationEnabled(boolean scaleVelocityAnimationEnabled)
Set whether scale velocity animation should execute after users finishes a gesture.
|
void |
setScrollGesturesEnabled(boolean scrollGesturesEnabled)
Changes whether the user may scroll around the map.
|
void |
setTiltGesturesEnabled(boolean tiltGesturesEnabled)
Changes whether the user may tilt the map.
|
void |
setZoomControlsEnabled(boolean zoomControlsEnabled)
Sets whether the zoom controls are enabled.
|
void |
setZoomGesturesEnabled(boolean zoomGesturesEnabled)
Changes whether the user may zoom the map.
|
public void setCompassEnabled(boolean compassEnabled)
Enables or disables the compass. The compass is an icon on the map that indicates the direction of north on the map. When a user clicks the compass, the camera orients itself to its default orientation and fades away shortly after. If disabled, the compass will never be displayed.
By default, the compass is enabled.compassEnabled
- True to enable the compass; false to disable the compass.public boolean isCompassEnabled()
@UiThread public void setCompassGravity(int gravity)
Sets the gravity of the compass view. Use this to change the corner of the map view that the compass is displayed in.
By default, the compass is in the top right corner.gravity
- Android SDK Gravity.public void setCompassFadeFacingNorth(boolean compassFadeFacingNorth)
By default this feature is enabled
compassFadeFacingNorth
- True to enable the fading animation; false to disable itpublic void setCompassImage(android.graphics.drawable.Drawable compass)
By default this value is R.drawable.mapbox_compass_icon.
compass
- the drawable to show as image compasspublic boolean isCompassFadeWhenFacingNorth()
public int getCompassGravity()
@UiThread public void setCompassMargins(int left, int top, int right, int bottom)
left
- The left margin in pixels.top
- The top margin in pixels.right
- The right margin in pixels.bottom
- The bottom margin in pixels.public int getCompassMarginLeft()
public int getCompassMarginTop()
public int getCompassMarginRight()
public int getCompassMarginBottom()
public android.graphics.drawable.Drawable getCompassImage()
public void setLogoEnabled(boolean enabled)
Enables or disables the Mapbox logo.
By default, the logo is enabled.enabled
- True to enable the logo; false to disable the logo.public boolean isLogoEnabled()
public void setLogoGravity(int gravity)
Sets the gravity of the logo view. Use this to change the corner of the map view that the Mapbox logo is displayed in.
By default, the logo is in the bottom left corner.gravity
- Android SDK Gravity.public int getLogoGravity()
public void setLogoMargins(int left, int top, int right, int bottom)
left
- The left margin in pixels.top
- The top margin in pixels.right
- The right margin in pixels.bottom
- The bottom margin in pixels.public int getLogoMarginLeft()
public int getLogoMarginTop()
public int getLogoMarginRight()
public int getLogoMarginBottom()
public void setAttributionEnabled(boolean enabled)
Enables or disables the attribution.
By default, the attribution is enabled.enabled
- True to enable the attribution; false to disable the attribution.public boolean isAttributionEnabled()
public void setAttributionDialogManager(AttributionDialogManager attributionDialogManager)
Set to null to reset to default behaviour.
attributionDialogManager
- the manager class used for showing attributionpublic AttributionDialogManager getAttributionDialogManager()
public void setAttributionGravity(int gravity)
Sets the gravity of the attribution.
By default, the attribution is in the bottom left corner next to the Mapbox logo.gravity
- Android SDK Gravity.public int getAttributionGravity()
public void setAttributionMargins(int left, int top, int right, int bottom)
left
- The left margin in pixels.top
- The top margin in pixels.right
- The right margin in pixels.bottom
- The bottom margin in pixels.public void setAttributionTintColor(int tintColor)
Sets the tint of the attribution view. Use this to change the color of the attribution.
By default, the logo is tinted with the primary color of your theme.tintColor
- Color to tint the attribution.public int getAttributionMarginLeft()
public int getAttributionMarginTop()
public int getAttributionMarginRight()
public int getAttributionMarginBottom()
public void setRotateGesturesEnabled(boolean rotateGesturesEnabled)
Changes whether the user may rotate the map.
This setting controls only user interactions with the map. If you set the value to false, you may still change the map location programmatically.
The default value is true.rotateGesturesEnabled
- If true, rotating is enabled.public boolean isRotateGesturesEnabled()
public void setTiltGesturesEnabled(boolean tiltGesturesEnabled)
Changes whether the user may tilt the map.
This setting controls only user interactions with the map. If you set the value to false, you may still change the map location programmatically.
The default value is true.tiltGesturesEnabled
- If true, tilting is enabled.public boolean isTiltGesturesEnabled()
public void setZoomGesturesEnabled(boolean zoomGesturesEnabled)
Changes whether the user may zoom the map.
This setting controls only user interactions with the map. If you set the value to false, you may still change the map location programmatically.
The default value is true.zoomGesturesEnabled
- If true, zooming is enabled.public boolean isZoomGesturesEnabled()
public void setZoomControlsEnabled(boolean zoomControlsEnabled)
Sets whether the zoom controls are enabled. If enabled, the zoom controls are a pair of buttons (one for zooming in, one for zooming out) that appear on the screen. When pressed, they cause the camera to zoom in (or out) by one zoom level. If disabled, the zoom controls are not shown.
By default the zoom controls are enabled if the device is only single touch capable;zoomControlsEnabled
- If true, the zoom controls are enabled.public boolean isZoomControlsEnabled()
public void setDoubleTapGesturesEnabled(boolean doubleTapGesturesEnabled)
Changes whether the user may zoom the map with a double tap.
This setting controls only user interactions with the map. If you set the value to false, you may still change the map location programmatically.
The default value is true.doubleTapGesturesEnabled
- If true, zooming with a double tap is enabled.public boolean isDoubleTapGesturesEnabled()
public boolean isDeselectMarkersOnTap()
public void setDeselectMarkersOnTap(boolean deselectMarkersOnTap)
deselectMarkersOnTap
- determines if markers should be deslected on tappublic void setScrollGesturesEnabled(boolean scrollGesturesEnabled)
Changes whether the user may scroll around the map.
This setting controls only user interactions with the map. If you set the value to false, you may still change the map location programmatically.
The default value is true.scrollGesturesEnabled
- If true, scrolling is enabled.public boolean isScrollGesturesEnabled()
public boolean isScaleVelocityAnimationEnabled()
public void setScaleVelocityAnimationEnabled(boolean scaleVelocityAnimationEnabled)
scaleVelocityAnimationEnabled
- If true, scale velocity animation will be enabled.public boolean isRotateVelocityAnimationEnabled()
public void setRotateVelocityAnimationEnabled(boolean rotateVelocityAnimationEnabled)
rotateVelocityAnimationEnabled
- If true, rotate velocity animation will be enabled.public boolean isFlingVelocityAnimationEnabled()
public void setFlingVelocityAnimationEnabled(boolean flingVelocityAnimationEnabled)
flingVelocityAnimationEnabled
- If true, fling velocity animation will be enabled.public void setAllVelocityAnimationsEnabled(boolean allVelocityAnimationsEnabled)
allVelocityAnimationsEnabled
- If true, all velocity animations will be enabled.public boolean isIncreaseRotateThresholdWhenScaling()
public void setIncreaseRotateThresholdWhenScaling(boolean increaseRotateThresholdWhenScaling)
increaseRotateThresholdWhenScaling
- If true, rotation threshold will be increased.public boolean isIncreaseScaleThresholdWhenRotating()
public void setIncreaseScaleThresholdWhenRotating(boolean increaseScaleThresholdWhenRotating)
increaseScaleThresholdWhenRotating
- If true, scale threshold will be increased.public void setAllGesturesEnabled(boolean enabled)
Sets the preference for whether all gestures should be enabled or disabled.
This setting controls only user interactions with the map. If you set the value to false, you may still change the map location programmatically.
The default value is true.enabled
- If true, all gestures are available; otherwise, all gestures are disabled.)
,
setScrollGesturesEnabled(boolean)
,
setRotateGesturesEnabled(boolean)
,
setTiltGesturesEnabled(boolean)
public void setFocalPoint(@Nullable android.graphics.PointF focalPoint)
focalPoint
- the focal point to be used.public android.graphics.PointF getFocalPoint()
public float getHeight()
public float getWidth()
public void invalidate()