Class NavigationView
-
- All Implemented Interfaces:
-
android.graphics.drawable.Drawable.Callback,android.view.KeyEvent.Callback,android.view.ViewManager,android.view.ViewParent,android.view.accessibility.AccessibilityEventSource,androidx.core.view.NestedScrollingParent,androidx.core.view.NestedScrollingParent2,androidx.core.view.NestedScrollingParent3,androidx.lifecycle.LifecycleOwner,com.trimblemaps.mapsdk.maps.OnMapReadyCallback,com.trimblemaps.navigation.ui.internal.NavigationContract.View,com.trimblemaps.navigation.ui.listeners.InstructionListListener,com.trimblemaps.navigation.ui.listeners.NavigationViewButtonsListener
public class NavigationView extends CoordinatorLayout implements LifecycleOwner, OnMapReadyCallback, NavigationContract.View, InstructionListListener, NavigationViewButtonsListener
View that creates the drop-in UI.
Once started, this view will check if the Activity that inflated it was launched with a DirectionsRoute.
Or, if not found, this view will look for a set of Point coordinates. In the latter case, a new DirectionsRoute will be retrieved from Router.
Once valid data is obtained, this activity will immediately begin navigation with TrimbleMapsNavigation.
If launched with the simulation boolean set to true, a TrimbleMapsReplayer will be initialized and begin pushing updates.
This activity requires user permissions ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION have already been granted.
A TrimbleMaps access token must also be set by the developer (to initialize navigation).
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description NavigationView(Context context)NavigationView(Context context, AttributeSet attrs)NavigationView(Context context, AttributeSet attrs, int defStyleAttr)
-
Method Summary
Modifier and Type Method Description ArrivalBottomSheetgetArrivalBottomSheet()CancelBottomSheetgetCancelBottomSheet()voidonInstructionListVisibilityChanged(boolean visible)Triggered when the instruction list is shown or hidden. voidonCreate(@Nullable() Bundle savedInstanceState)Uses savedInstanceState as a cue to restore state (if not null). voidonLowMemory()Low memory must be reported so the MapView can react appropriately. booleanonBackPressed()If the instruction list is showing and onBackPressed is called, hide the instruction list and do not hide the activity or fragment. voidonSaveInstanceState(@NonNull() Bundle outState)Used to store the bottomsheet state and re-center button visibility. voidonRestoreInstanceState(@NonNull() Bundle savedInstanceState)Used to restore the bottomsheet state and re-center button visibility. voidonStart()voidonResume()voidonPause()voidonStop()voidcleanup()voidafterNavigation()voidonDestroy()Called to ensure the MapView is destroyed properly. LifecyclegetLifecycle()voidonMapReady(@NonNull() TrimbleMapsMap trimbleMapsMap)Fired after the map is ready, this is our cue to finish setting up the rest of the plugins / location engine. voidsetSummaryBehaviorState(int state)voidsetSummaryBehaviorHideable(boolean isHideable)booleanisSummaryBottomSheetHidden()voidresetCameraPosition()voidshowRecenterBtn()voidhideRecenterBtn()booleanisRecenterButtonVisible()voidshowCancelNavigationBtn()voidhideCancelNavigationBtn()voidshowSearchButton()voidhideSearchButton()voidshowTripPreviewButton()voidhideTripPreviewButton()voidshowButtons()voidhideButtons()booleanisLandscape()voidshow2d3dBtn()voidhide2d3dBtn()voidshowSoundButton()voidhideSoundButton()booleanisCancelNavigationButtonVisible()voiddrawRoutes(@NonNull() List<DirectionsRoute> directionsRoutes)voidaddMarker(Point position)booleanisWayNameVisible()Provides the current visibility of the way name view. voidupdateWayNameView(@NonNull() String wayName)Updates the text of the way name view below the navigation icon. voidsetWayNameActive(boolean isActive)Set the auto-query state to provide the default way names value with updateWaynameQueryMap. voidsetWayNameVisibility(boolean isVisible)Set the visibility state of the way name view. StringretrieveWayNameText()Provides the current text of the way name view. voidtakeScreenshot()voidstartCamera(@NonNull() DirectionsRoute directionsRoute)Used when starting this Activity for the first time. voidresumeCamera(@NonNull() Location location)Used after configuration changes to resume the camera to the last location update from the Navigation SDK. booleanupdateCameraRouteGeometryOverview()voidonFeedbackFlowStatusChanged(int status)voidonGuidanceViewChange(int left, int top, int width, int height)voidstartNavigation(@NonNull() NavigationViewOptions options)voidsetMapStyleDay()voidsetMapStyleNight()voidsetMapStyleSatellite()voidstopNavigation()Call this when the navigation session needs to end navigation without finishing the whole view voidonRecenterClick()voidinitialize(OnNavigationReadyCallback onNavigationReadyCallback)Should be called after onCreate. voidinitialize(OnNavigationReadyCallback onNavigationReadyCallback, @NonNull() CameraPosition initialMapCameraPosition)Should be called after onCreate. NavigationTrimbleMapsMapretrieveNavigationMap()Gives the ability to manipulate the map directly for anything that might not currently be supported. TrimbleMapsNavigationretrieveNavigation()Returns the instance of TrimbleMapsNavigation powering the NavigationView once navigation has started. LiveData<RouteProgress>retrieveRouteProgress()NavigationButtonretrieveSoundButton()Returns the sound button used for muting instructions Route2d3dOverviewButtonretrieveRoute2d3dOverviewBtn()FloatingActionButtonretrieveTripPreviewBtn()FloatingActionButtonretrieveSearchBtn()NavigationButtonretrieveFeedbackButton()Returns the feedback button for sending feedback about navigation NavigationButtonretrieveRecenterButton()Returns the re-center button for recentering on current location FloatingActionButtonretrieveCancelNavigationButton()NavigationAlertViewretrieveAlertView()Returns the NavigationAlertView that is shown during off-route events with "Report a Problem" text. booleanisVoiceGuidanceMuted()Returns the state of speech player whether it is muted or unmuted voidtoggleMute()This method toggles the mute state of speech player. UnitshowToast(String message)voidsetOnSettingsClickListener(SettingsClickListener listener)voidonFinalDestinationArrival(boolean enableDetailedFeedbackFlowAfterTbt, boolean enableArrivalExperienceFeedback)voidupdateRouteViewStateCamera()voidchangeCameraTo2D()voidchangeCameraTo3D()voidchangeCameraToRouteOverview()TrimbleMapsTripgetTrip()voidsetRoutesRequestCallback(RoutesRequestCallback routesRequestCallback)voidsetIsRunning(boolean isRunning)voidonMultiStopCancelNavigation()voidshowNavigationViewButtons()voidhideNavigationViewButtons()voidacceptFasterRoute(DirectionsResponse fasterRoutes)booleanisAnyBottomSheetShowing()Array<int>getInstructionLayoutLocation()Array<int>getSearchButtonLocation()Array<int>getSoundButtonLocation()Array<int>getRouteViewButtonLocation()Array<int>getTripPreviewButtonLocation()Array<int>getBottomSheetLocation()Array<int>getCancelButtonLocation()intgetNavigationButtonWidth()voidsetArrivalBottomSheetButtonCallback(ArrivalBottomSheetButtonCallback callback)voidsetExternalClearStopListener(CancelBottomSheet.OnClearStopListener listener)voidsetIsSubscribed(boolean isSubscribed)voidsetSettingDisplaySpeedLimit(boolean newSetting)voidsetSettingDisplaySpeedAlert(boolean newSetting)voidsetSettingsTheme(int setting)voidsetDisplaySearchButton(boolean visibility)-
Methods inherited from class androidx.coordinatorlayout.widget.CoordinatorLayout
dispatchDependentViewsChanged, doViewsOverlap, generateLayoutParams, getDependencies, getDependents, getLastWindowInsets, getNestedScrollAxes, getStatusBarBackground, isPointInChildBounds, onAttachedToWindow, onDetachedFromWindow, onDraw, onInterceptTouchEvent, onLayoutChild, onMeasureChild, onNestedFling, onNestedPreFling, onNestedPreScroll, onNestedScroll, onNestedScrollAccepted, onStartNestedScroll, onStopNestedScroll, onTouchEvent, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, setFitsSystemWindows, setOnHierarchyChangeListener, setStatusBarBackground, setStatusBarBackgroundColor, setStatusBarBackgroundResource, setVisibility -
Methods inherited from class android.view.ViewGroup
addChildrenForAccessibility, addExtraDataToAccessibilityNodeInfo, addFocusables, addKeyboardNavigationClusters, addStatesFromChildren, addTouchables, addView, bringChildToFront, childDrawableStateChanged, childHasTransientStateChanged, clearChildFocus, clearDisappearingChildren, clearFocus, dispatchApplyWindowInsets, dispatchCapturedPointerEvent, dispatchConfigurationChanged, dispatchCreateViewTranslationRequest, dispatchDisplayHint, dispatchDragEvent, dispatchDrawableHotspotChanged, dispatchFinishTemporaryDetach, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPointerCaptureChanged, dispatchProvideAutofillStructure, dispatchProvideStructure, dispatchScrollCaptureSearch, dispatchSetActivated, dispatchSetSelected, dispatchStartTemporaryDetach, dispatchSystemUiVisibilityChanged, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchWindowFocusChanged, dispatchWindowInsetsAnimationEnd, dispatchWindowInsetsAnimationPrepare, dispatchWindowInsetsAnimationProgress, dispatchWindowInsetsAnimationStart, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, endViewTransition, findFocus, findOnBackInvokedDispatcherForChild, findViewsWithText, focusSearch, focusableViewAvailable, gatherTransparentRegion, getAccessibilityClassName, getChildAt, getChildCount, getChildMeasureSpec, getChildVisibleRect, getClipChildren, getClipToPadding, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutMode, getLayoutTransition, getOverlay, getPersistentDrawingCache, getTouchscreenBlocksFocus, hasFocus, hasTransientState, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isLayoutSuppressed, isMotionEventSplittingEnabled, isTransitionGroup, jumpDrawablesToCurrentState, layout, notifySubtreeAccessibilityStateChanged, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onDescendantInvalidated, onInterceptHoverEvent, onNestedPrePerformAccessibilityAction, onRequestSendAccessibilityEvent, onResolvePointerIcon, onViewAdded, onViewRemoved, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestFocus, requestSendAccessibilityEvent, requestTransparentRegion, restoreDefaultFocus, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutMode, setLayoutTransition, setMotionEventSplittingEnabled, setPersistentDrawingCache, setTouchscreenBlocksFocus, setTransitionGroup, setWindowInsetsAnimationCallback, shouldDelayChildPressedState, showContextMenuForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, suppressLayout, updateViewLayout -
Methods inherited from class android.view.View
addOnAttachStateChangeListener, addOnLayoutChangeListener, addOnUnhandledKeyEventListener, animate, announceForAccessibility, autofill, bringToFront, buildDrawingCache, buildLayer, callOnClick, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, cancelDragAndDrop, cancelLongPress, cancelPendingInputEvents, checkInputConnectionProxy, clearAnimation, clearPendingCredentialRequest, clearViewTranslationCallback, combineMeasuredStates, computeScroll, computeSystemWindowInsets, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchGenericMotionEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPopulateAccessibilityEvent, draw, drawableHotspotChanged, findOnBackInvokedDispatcher, findViewById, findViewWithTag, forceHasOverlappingRendering, forceLayout, generateDisplayHash, generateViewId, getAccessibilityDelegate, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilityPaneTitle, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAllowedHandwritingDelegatePackageName, getAllowedHandwritingDelegatorPackageName, getAlpha, getAnimation, getAnimationMatrix, getApplicationWindowToken, getAttributeResolutionStack, getAttributeSourceResourceMap, getAutofillHints, getAutofillId, getAutofillType, getAutofillValue, getBackground, getBackgroundTintBlendMode, getBackgroundTintList, getBackgroundTintMode, getBaseline, getBottom, getCameraDistance, getClipBounds, getClipBounds, getClipToOutline, getContentCaptureSession, getContentDescription, getContentSensitivity, getContext, getDefaultFocusHighlightEnabled, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getExplicitStyle, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusable, getFocusables, getFocusedRect, getForeground, getForegroundGravity, getForegroundTintBlendMode, getForegroundTintList, getForegroundTintMode, getFrameContentVelocity, getGlobalVisibleRect, getHandler, getHandwritingBoundsOffsetBottom, getHandwritingBoundsOffsetLeft, getHandwritingBoundsOffsetRight, getHandwritingBoundsOffsetTop, getHandwritingDelegateFlags, getHandwritingDelegatorCallback, getHasOverlappingRendering, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarThumbDrawable, getHorizontalScrollbarTrackDrawable, getId, getImportantForAccessibility, getImportantForAutofill, getImportantForContentCapture, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLocalVisibleRect, getLocationInSurface, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextClusterForwardId, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOutlineAmbientShadowColor, getOutlineProvider, getOutlineSpotShadowColor, getOverScrollMode, getOverlay, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPendingCredentialCallback, getPendingCredentialRequest, getPivotX, getPivotY, getPointerIcon, getPreferKeepClearRects, getReceiveContentMimeTypes, getRequestedFrameRate, getResources, getRevealOnFocusHint, getRight, getRootSurfaceControl, getRootView, getRootWindowInsets, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollCaptureHint, getScrollIndicators, getScrollX, getScrollY, getSolidColor, getSourceLayoutResId, getStateDescription, getStateListAnimator, getSystemGestureExclusionRects, getSystemUiVisibility, getTag, getTextAlignment, getTextDirection, getTooltipText, getTop, getTouchDelegate, getTouchables, getTransitionAlpha, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getUniqueDrawingId, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarThumbDrawable, getVerticalScrollbarTrackDrawable, getVerticalScrollbarWidth, getViewTranslationResponse, getViewTreeObserver, getVisibility, getWidth, getWindowId, getWindowInsetsController, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, hasExplicitFocusable, hasFocusable, hasNestedScrollingParent, hasOnClickListeners, hasOnLongClickListeners, hasOverlappingRendering, hasPointerCapture, hasWindowFocus, inflate, invalidate, invalidateDrawable, invalidateOutline, isAccessibilityDataSensitive, isAccessibilityFocused, isAccessibilityHeading, isActivated, isAttachedToWindow, isAutoHandwritingEnabled, isClickable, isContentSensitive, isContextClickable, isCredential, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isFocusedByDefault, isForceDarkAllowed, isHandwritingDelegate, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isImportantForAccessibility, isImportantForAutofill, isImportantForContentCapture, isInEditMode, isInLayout, isInTouchMode, isKeyboardNavigationCluster, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isNestedScrollingEnabled, isOpaque, isPaddingRelative, isPivotSet, isPreferKeepClear, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScreenReaderFocusable, isScrollContainer, isScrollbarFadingEnabled, isSelected, isShowingLayoutBounds, isShown, isSoundEffectsEnabled, isTemporarilyDetached, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, isVisibleToUserForAutofill, keyboardNavigationClusterSearch, measure, offsetLeftAndRight, offsetTopAndBottom, onApplyWindowInsets, onCancelPendingInputEvents, onCapturedPointerEvent, onCheckIsTextEditor, onCreateInputConnection, onCreateViewTranslationRequest, onCreateVirtualViewTranslationRequests, onDragEvent, onDrawForeground, onFilterTouchEventForSecurity, onFinishTemporaryDetach, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onPointerCaptureChange, onPopulateAccessibilityEvent, onProvideAutofillStructure, onProvideAutofillVirtualStructure, onProvideContentCaptureStructure, onProvideStructure, onProvideVirtualStructure, onReceiveContent, onRtlPropertiesChanged, onScreenStateChanged, onScrollCaptureSearch, onStartTemporaryDetach, onTrackballEvent, onViewTranslationResponse, onVirtualViewTranslationResponses, onVisibilityAggregated, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, performAccessibilityAction, performClick, performContextClick, performHapticFeedback, performLongClick, performReceiveContent, playSoundEffect, post, postDelayed, postInvalidate, postInvalidateDelayed, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, releasePointerCapture, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, removeOnUnhandledKeyEventListener, requestApplyInsets, requestFitSystemWindows, requestFocusFromTouch, requestLayout, requestPointerCapture, requestRectangleOnScreen, requestUnbufferedDispatch, requireViewById, resetPivot, resolveSize, resolveSizeAndState, restoreHierarchyState, saveAttributeDataForStyleable, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDataSensitive, setAccessibilityDelegate, setAccessibilityHeading, setAccessibilityLiveRegion, setAccessibilityPaneTitle, setAccessibilityTraversalAfter, setAccessibilityTraversalBefore, setActivated, setAllowClickWhenDisabled, setAllowedHandwritingDelegatePackage, setAllowedHandwritingDelegatorPackage, setAlpha, setAnimation, setAnimationMatrix, setAutoHandwritingEnabled, setAutofillHints, setAutofillId, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBackgroundTintBlendMode, setBackgroundTintList, setBackgroundTintMode, setBottom, setCameraDistance, setClickable, setClipBounds, setClipToOutline, setContentCaptureSession, setContentDescription, setContentSensitivity, setContextClickable, setDefaultFocusHighlightEnabled, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setElevation, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFocusable, setFocusableInTouchMode, setFocusedByDefault, setForceDarkAllowed, setForeground, setForegroundGravity, setForegroundTintBlendMode, setForegroundTintList, setForegroundTintMode, setFrameContentVelocity, setHandwritingBoundsOffsets, setHandwritingDelegateFlags, setHandwritingDelegatorCallback, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHorizontalScrollbarThumbDrawable, setHorizontalScrollbarTrackDrawable, setHovered, setId, setImportantForAccessibility, setImportantForAutofill, setImportantForContentCapture, setIsCredential, setIsHandwritingDelegate, setKeepScreenOn, setKeyboardNavigationCluster, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLeftTopRightBottom, setLongClickable, setMinimumHeight, setMinimumWidth, setNestedScrollingEnabled, setNextClusterForwardId, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnCapturedPointerListener, setOnClickListener, setOnContextClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnReceiveContentListener, setOnScrollChangeListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOutlineAmbientShadowColor, setOutlineProvider, setOutlineSpotShadowColor, setOverScrollMode, setPadding, setPaddingRelative, setPendingCredentialRequest, setPivotX, setPivotY, setPointerIcon, setPreferKeepClear, setPreferKeepClearRects, setPressed, setRenderEffect, setRequestedFrameRate, setRevealOnFocusHint, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScreenReaderFocusable, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollBarSize, setScrollBarStyle, setScrollCaptureCallback, setScrollCaptureHint, setScrollContainer, setScrollIndicators, setScrollX, setScrollY, setScrollbarFadingEnabled, setSelected, setSoundEffectsEnabled, setStateDescription, setStateListAnimator, setSystemGestureExclusionRects, setSystemUiVisibility, setTag, setTextAlignment, setTextDirection, setTooltipText, setTop, setTouchDelegate, setTransitionAlpha, setTransitionName, setTransitionVisibility, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVerticalScrollbarThumbDrawable, setVerticalScrollbarTrackDrawable, setViewTranslationCallback, setWillNotCacheDrawing, setWillNotDraw, setX, setY, setZ, showContextMenu, startActionMode, startAnimation, startDrag, startDragAndDrop, startNestedScroll, stopNestedScroll, toString, transformMatrixToGlobal, transformMatrixToLocal, unscheduleDrawable, updateDragShadow, willNotCacheDrawing, willNotDraw -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
NavigationView
NavigationView(Context context)
-
NavigationView
NavigationView(Context context, AttributeSet attrs)
-
NavigationView
NavigationView(Context context, AttributeSet attrs, int defStyleAttr)
-
-
Method Detail
-
getArrivalBottomSheet
ArrivalBottomSheet getArrivalBottomSheet()
-
getCancelBottomSheet
CancelBottomSheet getCancelBottomSheet()
-
onInstructionListVisibilityChanged
void onInstructionListVisibilityChanged(boolean visible)
Triggered when the instruction list is shown or hidden.
- Parameters:
visible- whether the list is shown or hidden
-
onCreate
void onCreate(@Nullable() Bundle savedInstanceState)
Uses savedInstanceState as a cue to restore state (if not null).
- Parameters:
savedInstanceState- to restore state if not null
-
onLowMemory
void onLowMemory()
Low memory must be reported so the MapView can react appropriately.
-
onBackPressed
boolean onBackPressed()
If the instruction list is showing and onBackPressed is called, hide the instruction list and do not hide the activity or fragment.
-
onSaveInstanceState
void onSaveInstanceState(@NonNull() Bundle outState)
Used to store the bottomsheet state and re-center button visibility. As well as anything the MapView needs to store in the bundle.
- Parameters:
outState- to store state variables
-
onRestoreInstanceState
void onRestoreInstanceState(@NonNull() Bundle savedInstanceState)
Used to restore the bottomsheet state and re-center button visibility. As well as the MapView position prior to a configuration change.
- Parameters:
savedInstanceState- to extract state variables
-
onStart
void onStart()
-
onResume
void onResume()
-
onPause
void onPause()
-
onStop
void onStop()
-
cleanup
void cleanup()
-
afterNavigation
void afterNavigation()
-
onDestroy
void onDestroy()
Called to ensure the MapView is destroyed properly.
In an Activity this should be in onDestroy().
In a androidx.fragment.app.Fragment, this should be in onDestroyView.
-
getLifecycle
@NonNull() Lifecycle getLifecycle()
-
onMapReady
void onMapReady(@NonNull() TrimbleMapsMap trimbleMapsMap)
Fired after the map is ready, this is our cue to finish setting up the rest of the plugins / location engine.
Also, we check for launch data (coordinates or route).
- Parameters:
trimbleMapsMap- used for route, camera, and location UI
-
setSummaryBehaviorState
void setSummaryBehaviorState(int state)
-
setSummaryBehaviorHideable
void setSummaryBehaviorHideable(boolean isHideable)
-
isSummaryBottomSheetHidden
boolean isSummaryBottomSheetHidden()
-
resetCameraPosition
void resetCameraPosition()
-
showRecenterBtn
void showRecenterBtn()
-
hideRecenterBtn
void hideRecenterBtn()
-
isRecenterButtonVisible
boolean isRecenterButtonVisible()
-
showCancelNavigationBtn
void showCancelNavigationBtn()
-
hideCancelNavigationBtn
void hideCancelNavigationBtn()
-
showSearchButton
void showSearchButton()
-
hideSearchButton
void hideSearchButton()
-
showTripPreviewButton
void showTripPreviewButton()
-
hideTripPreviewButton
void hideTripPreviewButton()
-
showButtons
void showButtons()
-
hideButtons
void hideButtons()
-
isLandscape
boolean isLandscape()
-
show2d3dBtn
void show2d3dBtn()
-
hide2d3dBtn
void hide2d3dBtn()
-
showSoundButton
void showSoundButton()
-
hideSoundButton
void hideSoundButton()
-
isCancelNavigationButtonVisible
boolean isCancelNavigationButtonVisible()
-
drawRoutes
void drawRoutes(@NonNull() List<DirectionsRoute> directionsRoutes)
-
addMarker
void addMarker(Point position)
-
isWayNameVisible
boolean isWayNameVisible()
Provides the current visibility of the way name view.
-
updateWayNameView
void updateWayNameView(@NonNull() String wayName)
Updates the text of the way name view below the navigation icon.
If you'd like to use this method without being overridden by the default way names values we provide, please disabled auto-query with updateWaynameQueryMap.
- Parameters:
wayName- to update the view
-
setWayNameActive
void setWayNameActive(boolean isActive)
Set the auto-query state to provide the default way names value with updateWaynameQueryMap.
- Parameters:
isActive- true if auto-query is enabled, false otherwise.
-
setWayNameVisibility
void setWayNameVisibility(boolean isVisible)
Set the visibility state of the way name view.
- Parameters:
isVisible- true if visible, false otherwise.
-
retrieveWayNameText
@NonNull() String retrieveWayNameText()
Provides the current text of the way name view.
-
takeScreenshot
void takeScreenshot()
-
startCamera
void startCamera(@NonNull() DirectionsRoute directionsRoute)
Used when starting this Activity for the first time.
Zooms to the beginning of the DirectionsRoute.
- Parameters:
directionsRoute- where camera should move to
-
resumeCamera
void resumeCamera(@NonNull() Location location)
Used after configuration changes to resume the camera to the last location update from the Navigation SDK.
- Parameters:
location- where the camera should move to
-
updateCameraRouteGeometryOverview
boolean updateCameraRouteGeometryOverview()
-
onFeedbackFlowStatusChanged
void onFeedbackFlowStatusChanged(int status)
-
onGuidanceViewChange
void onGuidanceViewChange(int left, int top, int width, int height)
-
startNavigation
void startNavigation(@NonNull() NavigationViewOptions options)
-
setMapStyleDay
void setMapStyleDay()
-
setMapStyleNight
void setMapStyleNight()
-
setMapStyleSatellite
void setMapStyleSatellite()
-
stopNavigation
void stopNavigation()
Call this when the navigation session needs to end navigation without finishing the whole view
-
onRecenterClick
void onRecenterClick()
-
initialize
void initialize(OnNavigationReadyCallback onNavigationReadyCallback)
Should be called after onCreate.
This method adds the OnNavigationReadyCallback, which will fire the ready events for this view.
- Parameters:
onNavigationReadyCallback- to be set to this view
-
initialize
void initialize(OnNavigationReadyCallback onNavigationReadyCallback, @NonNull() CameraPosition initialMapCameraPosition)
Should be called after onCreate.
This method adds the OnNavigationReadyCallback, which will fire the ready events for this view.
This method also accepts a CameraPosition that will be set as soon as the map is ready. Note, this position is ignored during a configuration change in favor of the last known map position.
- Parameters:
onNavigationReadyCallback- to be set to this viewinitialMapCameraPosition- to be shown once the map is ready
-
retrieveNavigationMap
@Nullable() NavigationTrimbleMapsMap retrieveNavigationMap()
Gives the ability to manipulate the map directly for anything that might not currently be supported. This returns null until the view is initialized.
The NavigationTrimbleMapsMap gives direct access to the map UI (location marker, route, etc.).
-
retrieveNavigation
@Nullable() TrimbleMapsNavigation retrieveNavigation()
Returns the instance of TrimbleMapsNavigation powering the NavigationView once navigation has started. Will return null if navigation has not been started with startNavigation.
-
retrieveRouteProgress
LiveData<RouteProgress> retrieveRouteProgress()
-
retrieveSoundButton
NavigationButton retrieveSoundButton()
Returns the sound button used for muting instructions
-
retrieveRoute2d3dOverviewBtn
Route2d3dOverviewButton retrieveRoute2d3dOverviewBtn()
-
retrieveTripPreviewBtn
FloatingActionButton retrieveTripPreviewBtn()
-
retrieveSearchBtn
FloatingActionButton retrieveSearchBtn()
-
retrieveFeedbackButton
NavigationButton retrieveFeedbackButton()
Returns the feedback button for sending feedback about navigation
-
retrieveRecenterButton
NavigationButton retrieveRecenterButton()
Returns the re-center button for recentering on current location
-
retrieveCancelNavigationButton
FloatingActionButton retrieveCancelNavigationButton()
-
retrieveAlertView
NavigationAlertView retrieveAlertView()
Returns the NavigationAlertView that is shown during off-route events with "Report a Problem" text.
-
isVoiceGuidanceMuted
boolean isVoiceGuidanceMuted()
Returns the state of speech player whether it is muted or unmuted
-
toggleMute
void toggleMute()
This method toggles the mute state of speech player. It also updates the UI to reflect the new state of speech player.
Should be called after startNavigation. Otherwise, it does nothing.
Can check the current mute state by calling isVoiceGuidanceMuted
-
setOnSettingsClickListener
void setOnSettingsClickListener(SettingsClickListener listener)
-
onFinalDestinationArrival
void onFinalDestinationArrival(boolean enableDetailedFeedbackFlowAfterTbt, boolean enableArrivalExperienceFeedback)
-
updateRouteViewStateCamera
void updateRouteViewStateCamera()
-
changeCameraTo2D
void changeCameraTo2D()
-
changeCameraTo3D
void changeCameraTo3D()
-
changeCameraToRouteOverview
void changeCameraToRouteOverview()
-
getTrip
TrimbleMapsTrip getTrip()
-
setRoutesRequestCallback
void setRoutesRequestCallback(RoutesRequestCallback routesRequestCallback)
-
setIsRunning
void setIsRunning(boolean isRunning)
-
onMultiStopCancelNavigation
void onMultiStopCancelNavigation()
-
showNavigationViewButtons
void showNavigationViewButtons()
-
hideNavigationViewButtons
void hideNavigationViewButtons()
-
acceptFasterRoute
void acceptFasterRoute(DirectionsResponse fasterRoutes)
-
isAnyBottomSheetShowing
boolean isAnyBottomSheetShowing()
-
getInstructionLayoutLocation
Array<int> getInstructionLayoutLocation()
-
getSearchButtonLocation
Array<int> getSearchButtonLocation()
-
getSoundButtonLocation
Array<int> getSoundButtonLocation()
-
getRouteViewButtonLocation
Array<int> getRouteViewButtonLocation()
-
getTripPreviewButtonLocation
Array<int> getTripPreviewButtonLocation()
-
getBottomSheetLocation
Array<int> getBottomSheetLocation()
-
getCancelButtonLocation
Array<int> getCancelButtonLocation()
-
getNavigationButtonWidth
int getNavigationButtonWidth()
-
setArrivalBottomSheetButtonCallback
void setArrivalBottomSheetButtonCallback(ArrivalBottomSheetButtonCallback callback)
-
setExternalClearStopListener
void setExternalClearStopListener(CancelBottomSheet.OnClearStopListener listener)
-
setIsSubscribed
void setIsSubscribed(boolean isSubscribed)
-
setSettingDisplaySpeedLimit
void setSettingDisplaySpeedLimit(boolean newSetting)
-
setSettingDisplaySpeedAlert
void setSettingDisplaySpeedAlert(boolean newSetting)
-
setSettingsTheme
void setSettingsTheme(int setting)
-
setDisplaySearchButton
void setDisplaySearchButton(boolean visibility)
-
-