NavigationState

public final class NavigationState
extends Object implements VersionedParcelable

java.lang.Object
   ↳ androidx.car.cluster.navigation.NavigationState


Navigation state data to be displayed on the instrument cluster of a car. This is composed by:

  • a list of destinations.
  • the immediate step or steps in order to drive towards those destinations.
This information can converted it to/from a Parcelable by using toParcelable() and fromParcelable(Parcelable), in order to be used in IPC (see Parcel).

Summary

Nested classes

class NavigationState.Builder

Builder for creating a NavigationState  

Public methods

boolean equals(Object o)
static NavigationState fromParcelable(Parcelable parcelable)

Creates a NavigationState based on data stored in the given Parcelable

List<Destination> getDestinations()

Returns the destination and intermediate stops in the navigation, sorted from nearest to furthest.

List<Step> getSteps()

Returns the navigation steps, in order of execution.

int hashCode()
Parcelable toParcelable()

Returns this NavigationState as a Parcelable

String toString()

Inherited methods

Public methods

equals

public boolean equals (Object o)

Parameters
o Object

Returns
boolean

fromParcelable

public static NavigationState fromParcelable (Parcelable parcelable)

Creates a NavigationState based on data stored in the given Parcelable

Parameters
parcelable Parcelable

Returns
NavigationState

getDestinations

public List<Destination> getDestinations ()

Returns the destination and intermediate stops in the navigation, sorted from nearest to furthest. This list should not be mutated.

Returns
List<Destination>

getSteps

public List<Step> getSteps ()

Returns the navigation steps, in order of execution. It is up to the producer to decide how many steps in advance will be provided. This list should not be mutated.

Returns
List<Step>

hashCode

public int hashCode ()

Returns
int

toParcelable

public Parcelable toParcelable ()

Returns this NavigationState as a Parcelable

Returns
Parcelable

toString

public String toString ()

Returns
String