NavigationView

public class NavigationView extends RelativeLayout

A View which displays a map for navigation.

Users of this class must forward all the life cycle methods from the Activity or Fragment containing this view to the corresponding ones in this class. In particular, you must forward on the following methods:

If the NavView is added after its parent Activity or Fragment has been through its creation lifecycle, you must call onCreate(Bundle), onStart() and onResume() manually to properly initialize it. Similarly, if a NavView is detached from its parent Activity or Fragment, you must manually call onPause(), onStop() and onDestroy() to prevent leaks.

Note: You are advised not to add children to this view.

All calls to NavView should be performed on the UI thread.

Nested Class Summary

interface NavigationView.OnNightModeChangedListener Interface for a listener which will be notified when the UI enters or exits "night mode". 
interface NavigationView.OnRecenterButtonClickedListener Interface for a listener which will be notified when the recenter button is clicked. 

Inherited Constant Summary

Inherited Field Summary

Public Constructor Summary

NavigationView(Context context)
NavigationView(Context context, AttributeSet attrs)
NavigationView(Context context, AttributeSet attrs, int defStyleAttr)

Public Method Summary

Camera
getCamera()
Returns a camera object which can be used to alter the viewport of the map.
NavigationMap
getMap()
Returns an object which can be used to add content to the map.
void
onConfigurationChanged(Configuration config)
void
onCreate(Bundle savedInstanceState)
void
void
void
void
onSaveInstanceState(Bundle outState)
void
void
onStop()
void
onTrimMemory(int level)
void
setCalloutInfoDisplayModeOverride(NavigationCalloutDisplayMode calloutInfoDisplayModeOverride)
Overrides default display mode for ETA callouts during navigation.
void
setCalloutInfoFormatOverride(RouteCalloutInfoFormat calloutInfoFormatOverride)
Sets the callout info format mode for route callouts.
void
setCompassEnabled(boolean enabled)
Sets whether the compass is visible.
void
setCustomControl(View control, CustomControlPosition position)
Sets a custom control view which will appear at the given position in the navigation UI.
void
setEtaCardEnabled(boolean enabled)
Sets whether the ETA card is visible during navigation.
void
setForceNightMode(int nightMode)
Sets the current ForceNightMode.
void
setHeaderEnabled(boolean enabled)
Sets whether the turn-by-turn navigation header is visible during navigation.
void
setOnNightModeChangedListener(NavigationView.OnNightModeChangedListener listener)
Sets a listener which will be notified immediately of the current "night mode" state and whenever when the UI enters or exits "night mode".
void
setOnRecenterButtonClickedListener(NavigationView.OnRecenterButtonClickedListener listener)
Sets a listener which will be notified when the recenter button is clicked.
void
setRecenterButtonEnabled(boolean enabled)
Sets whether the re-center button should be shown.
void
setSpeedAlertOptions(SpeedAlertOptions speedAlertOptions)
Sets SpeedAlertOptions for customizing the triggering thresholds for SpeedAlertSeveritys.
void
setSpeedLimitIconEnabled(boolean enabled)
Specifies whether the speed limit icon is shown.
void
setSpeedometerIconEnabled(boolean enabled)
Specifies whether the speedometer icon is shown.
void
setSpeedometerUiOptions(SpeedometerUiOptions speedometerUiOptions)
Sets the speedometer UI configuration SpeedometerUiOptions based on SpeedAlertSeverity.
void
setStylingOptions(StylingOptions stylingOptions)
Sets some styling options for the navigation UI.
void
setTrafficIncidentCardsEnabled(boolean enabled)
Sets whether traffic incident cards should be shown when the user clicks on a traffic incident icon.
void
setTrafficPromptsEnabled(boolean enabled)
Sets whether traffic prompts should be shown.

Inherited Method Summary