public final class

TravelEstimate.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.car.app.navigation.model.TravelEstimate.Builder

Overview

A builder of TravelEstimate.

Summary

Constructors
publicBuilder(Distance remainingDistance, DateTimeWithZone arrivalTimeAtDestination)

Constructs a new builder of TravelEstimate.

publicBuilder(Distance remainingDistance, java.time.ZonedDateTime arrivalTimeAtDestination)

Constructs a new builder of TravelEstimate.

Methods
public TravelEstimatebuild()

Constructs the TravelEstimate defined by this builder.

public TravelEstimate.BuildersetRemainingDistanceColor(CarColor remainingDistanceColor)

Sets the color of the remaining distance text.

public TravelEstimate.BuildersetRemainingTime(java.time.Duration remainingTime)

Sets the estimated time remaining until arriving at the destination.

public TravelEstimate.BuildersetRemainingTimeColor(CarColor remainingTimeColor)

Sets the color of the remaining time text.

public TravelEstimate.BuildersetRemainingTimeSeconds(long remainingTimeSeconds)

Sets the estimated time remaining until arriving at the destination, in seconds.

public TravelEstimate.BuildersetTripIcon(CarIcon tripIcon)

Sets a CarIcon that is associated with the current TravelEstimate

public TravelEstimate.BuildersetTripText(CarText tripText)

Sets the trip text.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder(Distance remainingDistance, DateTimeWithZone arrivalTimeAtDestination)

Constructs a new builder of TravelEstimate.

Parameters:

remainingDistance: The estimated remaining Distance until arriving at the destination
arrivalTimeAtDestination: The arrival time with the time zone information provided for the destination

public Builder(Distance remainingDistance, java.time.ZonedDateTime arrivalTimeAtDestination)

Constructs a new builder of TravelEstimate.

Parameters:

remainingDistance: The estimated remaining Distance until arriving at the destination
arrivalTimeAtDestination: The arrival time with the time zone information provided for the destination

Methods

public TravelEstimate.Builder setRemainingTimeSeconds(long remainingTimeSeconds)

Sets the estimated time remaining until arriving at the destination, in seconds.

If not set, TravelEstimate.REMAINING_TIME_UNKNOWN will be used.

Note that TravelEstimate.REMAINING_TIME_UNKNOWN may not be supported depending on where the TravelEstimate is used. See the documentation of where TravelEstimate is used for any restrictions that might apply.

public TravelEstimate.Builder setRemainingTime(java.time.Duration remainingTime)

Sets the estimated time remaining until arriving at the destination.

If not set, TravelEstimate.REMAINING_TIME_UNKNOWN will be used.

public TravelEstimate.Builder setRemainingTimeColor(CarColor remainingTimeColor)

Sets the color of the remaining time text.

Depending on contrast requirements, capabilities of the vehicle screens, or other factors, the color may be ignored by the host or overridden by the vehicle system.

If not set, CarColor.DEFAULT will be used.

Custom colors created with CarColor.createCustom(int, int) are not supported.

public TravelEstimate.Builder setRemainingDistanceColor(CarColor remainingDistanceColor)

Sets the color of the remaining distance text.

Depending on contrast requirements, capabilities of the vehicle screens, or other factors, the color may be ignored by the host or overridden by the vehicle system.

If not set, CarColor.DEFAULT will be used.

Custom colors created with CarColor.createCustom(int, int) are not supported.

public TravelEstimate.Builder setTripText(CarText tripText)

Sets the trip text.

A text that provides additional information about this TravelEstimate, such as drop off/pick up information, and battery level, that should be displayed on the screen alongside the remaining distance and time.

For example "Pick up Alice", "Drop off Susan", or "Battery Level is Low".

See also: CarText

public TravelEstimate.Builder setTripIcon(CarIcon tripIcon)

Sets a CarIcon that is associated with the current TravelEstimate

See CarIcon for more details related to providing icon and image resources that work with different car screen pixel densities.

public TravelEstimate build()

Constructs the TravelEstimate defined by this builder.