Register now for Android Dev Summit 2019!

NavigationState

class NavigationState : VersionedParcelable
kotlin.Any
   ↳ 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

Builder for creating a NavigationState

Possible service states

Public methods

Boolean
equals(other: Any?)

static NavigationState!
fromParcelable(@Nullable parcelable: Parcelable?)

Creates a NavigationState based on data stored in the given Parcelable

Segment?

Returns the current segment being driven, or null if the segment being driven is unknown.

MutableList<Destination!>

Returns an unmodifiable list of destinations and intermediate stops in the navigation, sorted from nearest to furthest.

NavigationState.ServiceStatus

Returns the service status (e.g.: normal operation, re-routing in progress, etc.).

MutableList<Step!>

Returns an unmodifiable list of navigation steps, in order of execution.

Int

Parcelable

Returns this NavigationState as a Parcelable

String

Public methods

equals

fun equals(other: Any?): Boolean

fromParcelable

static fun fromParcelable(@Nullable parcelable: Parcelable?): NavigationState!

Creates a NavigationState based on data stored in the given Parcelable

getCurrentSegment

@Nullable fun getCurrentSegment(): Segment?

Returns the current segment being driven, or null if the segment being driven is unknown.

getDestinations

@NonNull fun getDestinations(): MutableList<Destination!>

Returns an unmodifiable list of destinations and intermediate stops in the navigation, sorted from nearest to furthest.

getServiceStatus

@NonNull fun getServiceStatus(): NavigationState.ServiceStatus

Returns the service status (e.g.: normal operation, re-routing in progress, etc.).

getSteps

@NonNull fun getSteps(): MutableList<Step!>

Returns an unmodifiable list of navigation steps, in order of execution. It is up to the producer to decide how many steps in advance will be provided.

hashCode

fun hashCode(): Int

toParcelable

@NonNull fun toParcelable(): Parcelable

Returns this NavigationState as a Parcelable

toString

fun toString(): String