public class BaseGuidancePresenter
extends java.lang.Object
The class interacts with NavigationManager and PositioningManager to support
easier handling of guidance events.
| Modifier | Constructor and Description |
|---|---|
protected |
BaseGuidancePresenter(com.here.android.mpa.guidance.NavigationManager navigationManager,
com.here.android.mpa.routing.Route route)
Constructs a new instance using a
NavigationManager instance and
a route to follow during guidance. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
disableSpeedWarnings()
Called to de-register speed warnings listener.
|
protected void |
enableSpeedWarnings()
Enable listening to speed limit warnings.
|
com.here.android.mpa.routing.Maneuver |
getAfterNextManeuver()
Gets the
Maneuver after next Maneuver. |
long |
getDestinationDistance()
Gets distance to the destination.
|
java.util.Date |
getEta()
Gets estimated arrival date.
|
com.here.android.mpa.routing.Maneuver |
getNextManeuver()
Gets the next
Maneuver. |
long |
getNextManeuverDistance()
Gets the distance to the next
Maneuver. |
com.here.android.mpa.routing.Route |
getRoute()
Gets the route that was set to be used for guidance.
|
java.lang.Integer |
getTimeToArrival()
Gets time to arrive at the destination.
|
protected void |
handleGpsLost()
Notifies when GPS signal is lost.
|
protected void |
handleGpsRestore()
Notifies when GPS signal is restored.
|
protected void |
handleManeuverEvent()
Called after resuming the presenter.
|
protected void |
handleNewInstructionEvent()
Notifies on new instruction events generated by
NavigationManager. |
protected void |
handlePositionUpdate() |
protected void |
handleRerouteBegin()
Notifies when rerouting begins.
|
protected void |
handleRerouteEnd(com.here.android.mpa.routing.RouteResult routeResult)
Notifies when rerouting ends with success.
|
protected void |
handleRerouteFailed(com.here.android.mpa.routing.RoutingError error)
Notifies when rerouting ends with failure.
|
protected void |
handleSpeedExceeded(float speedLimit)
Notifies when driving over speed limit.
|
protected void |
handleSpeedExceededEnd(float speedLimit)
Notifies when no longer driving over speed limit.
|
void |
pause()
Pauses presenter to stop listening to navigation events.
|
void |
resume()
Resumes presenter to start listening to navigation events.
|
void |
setRoute(com.here.android.mpa.routing.Route route)
Sets a new route that should be used for guidance.
|
protected BaseGuidancePresenter(@NonNull
com.here.android.mpa.guidance.NavigationManager navigationManager,
com.here.android.mpa.routing.Route route)
NavigationManager instance and
a route to follow during guidance.navigationManager - a NavigationManager.route - a route to be used for guidance.public void resume()
public void pause()
protected final void enableSpeedWarnings()
protected final void disableSpeedWarnings()
protected void handleManeuverEvent()
protected void handleNewInstructionEvent()
NavigationManager.
Subclasses may override the method if they are interested in the events forwarded by
NavigationManager.NewInstructionEventListener.protected void handleGpsLost()
protected void handleGpsRestore()
protected void handleRerouteBegin()
protected void handleRerouteEnd(com.here.android.mpa.routing.RouteResult routeResult)
routeResult - RouteResult object containing Route as result of route
calculation.protected void handleRerouteFailed(com.here.android.mpa.routing.RoutingError error)
error - rerouting error.protected void handlePositionUpdate()
protected void handleSpeedExceeded(float speedLimit)
speedLimit - current speed limit.protected void handleSpeedExceededEnd(float speedLimit)
speedLimit - current speed limit.public com.here.android.mpa.routing.Maneuver getNextManeuver()
Maneuver.Maneuver.public com.here.android.mpa.routing.Maneuver getAfterNextManeuver()
Maneuver after next Maneuver.Maneuver.public long getNextManeuverDistance()
Maneuver.Maneuver.public com.here.android.mpa.routing.Route getRoute()
public void setRoute(com.here.android.mpa.routing.Route route)
route - a route.@Nullable public java.util.Date getEta()
Date of arrival at the destination.public long getDestinationDistance()
public java.lang.Integer getTimeToArrival()