Android 12 Developer Preview is here! Try it out, and give us your feedback!

TravelEstimate

public final class TravelEstimate
extends Object

java.lang.Object
   ↳ androidx.car.app.navigation.model.TravelEstimate


Represents the travel estimates to a destination of a trip or for a trip segment, including the remaining time and distance to the destination.

Summary

Nested classes

class TravelEstimate.Builder

A builder of TravelEstimate

Constants

long REMAINING_TIME_UNKNOWN

A value used to represent an unknown remaining amount of time.

Public methods

boolean equals(Object other)
DateTimeWithZone getArrivalTimeAtDestination()

Returns the arrival time until at the destination or null if not set.

Distance getRemainingDistance()

Returns the remaining Distance until arriving at the destination, or null if not set.

CarColor getRemainingDistanceColor()

Sets the color of the remaining distance text or null if not set.

CarColor getRemainingTimeColor()

Sets the color of the remaining time text or null if not set.

long getRemainingTimeSeconds()

Returns the remaining time until arriving at the destination, in seconds.

int hashCode()
String toString()

Inherited methods

Constants

REMAINING_TIME_UNKNOWN

public static final long REMAINING_TIME_UNKNOWN

A value used to represent an unknown remaining amount of time.

Constant Value: -1 (0xffffffffffffffff)

Public methods

equals

public boolean equals (Object other)

Parameters
other Object

Returns
boolean

getArrivalTimeAtDestination

public DateTimeWithZone getArrivalTimeAtDestination ()

Returns the arrival time until at the destination or null if not set.

Returns
DateTimeWithZone

getRemainingDistance

public Distance getRemainingDistance ()

Returns the remaining Distance until arriving at the destination, or null if not set.

Returns
Distance

getRemainingDistanceColor

public CarColor getRemainingDistanceColor ()

Sets the color of the remaining distance text or null if not set.

Returns
CarColor

getRemainingTimeColor

public CarColor getRemainingTimeColor ()

Sets the color of the remaining time text or null if not set.

Returns
CarColor

getRemainingTimeSeconds

public long getRemainingTimeSeconds ()

Returns the remaining time until arriving at the destination, in seconds.

Returns
long

hashCode

public int hashCode ()

Returns
int

toString

public String toString ()

Returns
String