# Trip

# Trip

Artifact:[androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app)  
[View Source](https://cs.android.com/search?q=file:androidx/car/app/navigation/model/Trip.java+class:androidx.car.app.navigation.model.Trip)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/car/app/navigation/model/Trip "View this page in Java")

<br />

```
@CarProtocol
class Trip
```

<br />

*** ** * ** ***

Represents information about a trip including destinations, steps, and travel estimates.

This information data**may**be displayed in different places in the car such as the instrument cluster screens, heads-up display and floating navigation bar.

Floating navigation bar can show current navigating info in three templates including[MapTemplate](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/MapTemplate),[RoutePreviewNavigationTemplate](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/RoutePreviewNavigationTemplate)and[PlaceListNavigationTemplate](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/PlaceListNavigationTemplate). The navigating steps can be added with the use of[addStep](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Trip.Builder#addStep(androidx.car.app.navigation.model.Step,androidx.car.app.navigation.model.TravelEstimate)). There are three navigation info showing in the floating nav bar including:

- The current road description get from[getCue](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Step#getCue())of the current[Step](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Step), which gets from the first element of[getSteps](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Trip#getSteps())
- The remaining distance of the current road get from[getRemainingDistance](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/TravelEstimate#getRemainingDistance())of the first element of[getStepTravelEstimates](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Trip#getStepTravelEstimates())
- The turn icon get from[getIcon](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Maneuver#getIcon())from the[Maneuver](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Maneuver)of the current[Step](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Step)

## Summary

|                                                                                                         ### Nested types                                                                                                         |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[Trip.Builder](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Trip.Builder) A builder of[Trip](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Trip). |

|                                                                                                                                                    ### Public functions                                                                                                                                                     |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                                                                                                                                                         | [equals](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Trip#equals(java.lang.Object))`(other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)`                                                                                                                                                                                                                 |
| [CarText](https://developer.android.com/reference/kotlin/androidx/car/app/model/CarText)`?`                                                                                                                                                                                                                                 | [getCurrentRoad](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Trip#getCurrentRoad())`()` Returns the text that describes the current road.                                                                                                                                                                                                                                                    |
| `(`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[TravelEstimate](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/TravelEstimate)`!>` | [getDestinationTravelEstimates](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Trip#getDestinationTravelEstimates())`()` Returns the list of[TravelEstimate](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/TravelEstimate)s for the[Destination](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Destination)s in the trip. |
| `(`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[Destination](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Destination)`!>`       | [getDestinations](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Trip#getDestinations())`()` Returns the list of destinations for this trip.                                                                                                                                                                                                                                                    |
| `(`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[TravelEstimate](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/TravelEstimate)`!>` | [getStepTravelEstimates](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Trip#getStepTravelEstimates())`()` Returns the list of[TravelEstimate](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/TravelEstimate)s for the[Step](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Step)s in the trip.                             |
| `(`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[Step](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Step)`!>`                     | [getSteps](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Trip#getSteps())`()` Returns the list of steps for the trip.                                                                                                                                                                                                                                                                          |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                                                                                                                                                                                 | [hashCode](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Trip#hashCode())`()`                                                                                                                                                                                                                                                                                                                  |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                                                                                                                                                         | [isLoading](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Trip#isLoading())`()` Returns whether the trip is in a loading state.                                                                                                                                                                                                                                                                |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                                                                                                                                                                                                                                           | [toString](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Trip#toString())`()`                                                                                                                                                                                                                                                                                                                  |

## Public functions

### equals

```
fun equals(other: Any?): Boolean
```  

### getCurrentRoad

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)  

```
fun getCurrentRoad(): CarText?
```

Returns the text that describes the current road.  

|                                                                        See also                                                                        |
|--------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [setCurrentRoad](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Trip.Builder#setCurrentRoad(java.lang.CharSequence)) |   |

### getDestinationTravelEstimates

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)  

```
fun getDestinationTravelEstimates(): (Mutable)List<TravelEstimate!>
```

Returns the list of[TravelEstimate](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/TravelEstimate)s for the[Destination](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Destination)s in the trip.  

|                                                                                                            See also                                                                                                            |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [addDestination](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Trip.Builder#addDestination(androidx.car.app.navigation.model.Destination,androidx.car.app.navigation.model.TravelEstimate)) |   |

### getDestinations

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)  

```
fun getDestinations(): (Mutable)List<Destination!>
```

Returns the list of destinations for this trip.  

|                                                                                                            See also                                                                                                            |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [addDestination](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Trip.Builder#addDestination(androidx.car.app.navigation.model.Destination,androidx.car.app.navigation.model.TravelEstimate)) |   |

### getStepTravelEstimates

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)  

```
fun getStepTravelEstimates(): (Mutable)List<TravelEstimate!>
```

Returns the list of[TravelEstimate](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/TravelEstimate)s for the[Step](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Step)s in the trip.  

|                                                                                                            See also                                                                                                            |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [addDestination](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Trip.Builder#addDestination(androidx.car.app.navigation.model.Destination,androidx.car.app.navigation.model.TravelEstimate)) |   |

### getSteps

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)  

```
fun getSteps(): (Mutable)List<Step!>
```

Returns the list of steps for the trip.  

|                                                                                                 See also                                                                                                  |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [addStep](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Trip.Builder#addStep(androidx.car.app.navigation.model.Step,androidx.car.app.navigation.model.TravelEstimate)) |   |

### hashCode

```
fun hashCode(): Int
```  

### isLoading

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)  

```
fun isLoading(): Boolean
```

Returns whether the trip is in a loading state.  

|                                                            See also                                                             |
|---------------------------------------------------------------------------------------------------------------------------------|---|
| [setLoading](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Trip.Builder#setLoading(boolean)) |   |

### toString

```
fun toString(): String
```