public final class UiSettings
extends java.lang.Object
Modifier and Type | Method | Description |
---|---|---|
boolean |
areAllGesturesEnabled() |
Retrieves the current status of whether all gestures are enabled.
|
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 in pixels.
|
int |
getAttributionMarginLeft() |
Returns the left side margin of the attribution view in pixels.
|
int |
getAttributionMarginRight() |
Returns the right side margin of the attribution view in pixels.
|
int |
getAttributionMarginTop() |
Returns the top side margin of the attribution view in pixels.
|
int |
getCompassGravity() |
Returns the gravity value of the CompassView
|
android.graphics.drawable.Drawable |
getCompassImage() |
Deprecated.
use
getCompassImageResource() instead |
int |
getCompassImageResource() |
Get the current configured id of the CompassView drawable resource.
|
int |
getCompassMarginBottom() |
Returns the bottom side margin of CompassView in pixels.
|
int |
getCompassMarginLeft() |
Returns the left side margin of CompassView in pixels.
|
int |
getCompassMarginRight() |
Returns the right side margin of CompassView in pixels.
|
int |
getCompassMarginTop() |
Returns the top side margin of CompassView in pixels.
|
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 in pixels.
|
int |
getLogoMarginLeft() |
Returns the left side margin of the logo in pixels.
|
int |
getLogoMarginRight() |
Returns the right side margin of the logo in pixels.
|
int |
getLogoMarginTop() |
Returns the top side margin of the logo in pixels.
|
float |
getWidth() |
Returns the measured width of the MapView
|
float |
getZoomRate() |
Returns zoom gesture rate, including pinch to zoom and quick scale.
|
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 |
isDisableRotateWhenScaling() |
Returns whether rotation gesture detector is disabled when scale is detected first.
|
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 |
isHorizontalScrollGesturesEnabled() |
Returns whether the user may scroll horizontally around the map.
|
boolean |
isIncreaseRotateThresholdWhenScaling() |
Deprecated.
unused, see
isDisableRotateWhenScaling() instead |
boolean |
isIncreaseScaleThresholdWhenRotating() |
Returns whether scale threshold should be increase whenever rotation is detected.
|
boolean |
isLogoEnabled() |
Returns whether the logo is enabled.
|
boolean |
isQuickZoomGesturesEnabled() |
Returns whether the user may zoom the map by tapping twice, holding and moving the pointer up and down.
|
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 |
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 in pixels.
|
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) |
Deprecated.
use
setCompassImageResource(int) instead |
void |
setCompassImageResource(int drawableRes) |
Specifies the CompassView image.
|
void |
setCompassMargins(int left,
int top,
int right,
int bottom) |
Sets the margins of the compass view in pixels.
|
void |
setDeselectMarkersOnTap(boolean deselectMarkersOnTap) |
Sets whether the markers are automatically deselected (and therefore, their infowindows
closed) when a map tap is detected.
|
void |
setDisableRotateWhenScaling(boolean disableRotateWhenScaling) |
Set whether rotation gesture detector should be disabled when scale is detected first.
|
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 |
setHorizontalScrollGesturesEnabled(boolean horizontalScrollGesturesEnabled) |
Changes whether the user may scroll horizontally around the map.
|
void |
setIncreaseRotateThresholdWhenScaling(boolean increaseRotateThresholdWhenScaling) |
Deprecated.
unused, see
setDisableRotateWhenScaling(boolean) instead |
void |
setIncreaseScaleThresholdWhenRotating(boolean increaseScaleThresholdWhenRotating) |
set whether scale threshold should be increase whenever rotation is detected.
|
void |
setLogoEnabled(boolean enabled) |
Enables or disables the TrimbleMaps 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 in pixels.
|
void |
setQuickZoomGesturesEnabled(boolean quickZoomGesturesEnabled) |
Changes whether the user may zoom the map by tapping twice, holding and moving the pointer up and down.
|
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 |
setZoomGesturesEnabled(boolean zoomGesturesEnabled) |
Changes whether the user may zoom the map.
|
void |
setZoomRate(float zoomRate) |
Sets zoom gesture rate, including pinch to zoom and quick scale.
|
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 it@Deprecated public void setCompassImage(@NonNull android.graphics.drawable.Drawable compass)
setCompassImageResource(int)
insteadBy default this value is R.drawable.trimblemaps_compass_icon.
compass
- the drawable to show as image compasspublic void setCompassImageResource(@DrawableRes int drawableRes)
By default this value is R.drawable.trimblemaps_compass_icon.
drawableRes
- the resource id of the drawable to show as image compasspublic boolean isCompassFadeWhenFacingNorth()
public int getCompassGravity()
@UiThread public void setCompassMargins(@Px int left, @Px int top, @Px int right, @Px 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.@Px public int getCompassMarginLeft()
@Px public int getCompassMarginTop()
@Px public int getCompassMarginRight()
@Px public int getCompassMarginBottom()
@Nullable @Deprecated public android.graphics.drawable.Drawable getCompassImage()
getCompassImageResource()
instead@DrawableRes @Nullable public int getCompassImageResource()
public void setLogoEnabled(boolean enabled)
Enables or disables the TrimbleMaps 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 TrimbleMaps logo is displayed in.
By default, the logo is in the bottom left corner.gravity
- Android SDK Gravity.public int getLogoGravity()
public void setLogoMargins(@Px int left, @Px int top, @Px int right, @Px 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.@Px public int getLogoMarginLeft()
@Px public int getLogoMarginTop()
@Px public int getLogoMarginRight()
@Px 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(@NonNull AttributionDialogManager attributionDialogManager)
Set to null to reset to default behaviour.
attributionDialogManager
- the manager class used for showing attribution@Nullable public 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 TrimbleMaps logo.gravity
- Android SDK Gravity.public int getAttributionGravity()
public void setAttributionMargins(@Px int left, @Px int top, @Px int right, @Px 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.
tintColor
- Color to tint the attribution.@Px public int getAttributionMarginLeft()
@Px public int getAttributionMarginTop()
@Px public int getAttributionMarginRight()
@Px 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 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 isQuickZoomGesturesEnabled()
public void setQuickZoomGesturesEnabled(boolean quickZoomGesturesEnabled)
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.quickZoomGesturesEnabled
- If true, zooming by tapping twice and holding is enabled.public float getZoomRate()
public void setZoomRate(float zoomRate)
Default value is 1.0f.
zoomRate
- The zoom rate.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 void setHorizontalScrollGesturesEnabled(boolean horizontalScrollGesturesEnabled)
Changes whether the user may scroll horizontally 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.horizontalScrollGesturesEnabled
- If true, scrolling horizontally is enabled.public boolean isHorizontalScrollGesturesEnabled()
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.@Deprecated public boolean isIncreaseRotateThresholdWhenScaling()
isDisableRotateWhenScaling()
instead@Deprecated public void setIncreaseRotateThresholdWhenScaling(boolean increaseRotateThresholdWhenScaling)
setDisableRotateWhenScaling(boolean)
insteadincreaseRotateThresholdWhenScaling
- If true, rotation threshold will be increased.public boolean isDisableRotateWhenScaling()
public void setDisableRotateWhenScaling(boolean disableRotateWhenScaling)
disableRotateWhenScaling
- If true, rotation gesture detector will be disabled when scale is detected first.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)
,
setDoubleTapGesturesEnabled(boolean)
,
setQuickZoomGesturesEnabled(boolean)
public boolean areAllGesturesEnabled()
Retrieves the current status of whether all gestures are enabled.
public void setFocalPoint(@Nullable android.graphics.PointF focalPoint)
focalPoint
- the focal point to be used.@Nullable public android.graphics.PointF getFocalPoint()
public float getHeight()
public float getWidth()
public void invalidate()