Trip.Builder
class Trip.Builder
A builder of Trip.
Summary
Public functions |
|
|---|---|
Trip.Builder |
addDestination(Adds a destination to the trip. |
Trip.Builder |
addStep(step: Step, stepTravelEstimate: TravelEstimate)Adds a step to the trip. |
Trip |
build()Constructs the |
Trip.Builder |
setCurrentRoad(currentRoad: CharSequence)Sets a description of the current road. |
Trip.Builder |
setLoading(isLoading: Boolean)Sets whether the |
Public functions
addDestination
fun addDestination(
destination: Destination,
destinationTravelEstimate: TravelEstimate
): Trip.Builder
Adds a destination to the trip.
Destinations must be added in order of arrival. A destination is not required. Display surfaces may or may not use the destination and if multiple destinations are added the display may only show information about the first destination.
For every destination added, a corresponding TravelEstimate must be provided. Display surfaces may or may not use the destination travel estimate and if multiple destination travel estimates are added the display may only show information about the first destination travel estimate.
| Throws | |
|---|---|
java.lang.NullPointerException |
if |
addStep
fun addStep(step: Step, stepTravelEstimate: TravelEstimate): Trip.Builder
Adds a step to the trip.
Steps must be added in order of arrival. A step is not required. Display surfaces may or may not use the step and if multiple steps are added the display may only show information about the first step.
For every step added, a corresponding TravelEstimate must be provided. Display surfaces may or may not use the step travel estimate and if multiple step travel estimates are added the display may only show information about the first step travel estimate.
| Throws | |
|---|---|
java.lang.NullPointerException |
if |
setCurrentRoad
fun setCurrentRoad(currentRoad: CharSequence): Trip.Builder
Sets a description of the current road.
Spans are not supported in the input string and will be ignored.
| Throws | |
|---|---|
java.lang.NullPointerException |
if |
| See also | |
|---|---|
CarText |
setLoading
fun setLoading(isLoading: Boolean): Trip.Builder
Sets whether the Trip is in a loading state.
If set to true, the UI may show a loading indicator, and adding any steps or step travel estimates will throw an IllegalArgumentException.