# LaneDirection

# LaneDirection

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/LaneDirection.java+class:androidx.car.app.navigation.model.LaneDirection)  
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/LaneDirection "View this page in Java")

<br />

```
@CarProtocol
class LaneDirection
```

<br />

*** ** * ** ***

Defines the possible directions a driver can go when using a particular lane at a particular step in the navigation.

These directions can be combined and sent to the host to display a lane configuration to the user.  

|                                           See also                                            |
|-----------------------------------------------------------------------------------------------|---|
| [Lane](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/Lane) |   |

## Summary

|                                    ### Constants                                    |
|-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [SHAPE_NORMAL_LEFT](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/LaneDirection#SHAPE_NORMAL_LEFT())` = 5` Regular left turn, from 45 (included) to 135 (excluded) degrees.                                         |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [SHAPE_NORMAL_RIGHT](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/LaneDirection#SHAPE_NORMAL_RIGHT())` = 6` Regular right turn, from 45 (included) to 135 (excluded) degrees.                                      |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [SHAPE_SHARP_LEFT](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/LaneDirection#SHAPE_SHARP_LEFT())` = 7` Sharp left turn, from 135 (included) to 175 (excluded) degrees.                                            |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [SHAPE_SHARP_RIGHT](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/LaneDirection#SHAPE_SHARP_RIGHT())` = 8` Sharp right turn, from 135 (included) to 175 (excluded) degrees.                                         |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [SHAPE_SLIGHT_LEFT](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/LaneDirection#SHAPE_SLIGHT_LEFT())` = 3` Slight left turn, from 10 (included) to 45 (excluded) degrees.                                           |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [SHAPE_SLIGHT_RIGHT](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/LaneDirection#SHAPE_SLIGHT_RIGHT())` = 4` Slight right turn, from 10 (included) to 45 (excluded) degrees.                                        |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [SHAPE_STRAIGHT](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/LaneDirection#SHAPE_STRAIGHT())` = 2` No turn.                                                                                                       |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [SHAPE_UNKNOWN](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/LaneDirection#SHAPE_UNKNOWN())` = 1` The shape is unknown, in which case no lane information should be shown.                                         |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [SHAPE_U_TURN_LEFT](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/LaneDirection#SHAPE_U_TURN_LEFT())` = 9` A left turn onto the opposite side of the same street, from 175 (included) to 180 (included) degrees     |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [SHAPE_U_TURN_RIGHT](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/LaneDirection#SHAPE_U_TURN_RIGHT())` = 10` A right turn onto the opposite side of the same street, from 175 (included) to 180 (included) degrees |

|                                                     ### Public functions                                                      |
|-------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `java-static `[LaneDirection](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/LaneDirection) | [create](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/LaneDirection#create(int,boolean))`(shape: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, isRecommended: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Constructs a new instance of a[LaneDirection](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/LaneDirection). |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                           | [equals](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/LaneDirection#equals(java.lang.Object))`(other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)`                                                                                                                                                                                                                                                |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                   | [getShape](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/LaneDirection#getShape())`()` Returns shape of this lane direction.                                                                                                                                                                                                                                                                                                           |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                   | [hashCode](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/LaneDirection#hashCode())`()`                                                                                                                                                                                                                                                                                                                                                 |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                           | [isRecommended](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/LaneDirection#isRecommended())`()` Returns whether this is a direction the driver should take in order to stay on the navigation route.                                                                                                                                                                                                                                  |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                                             | [toString](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/LaneDirection#toString())`()`                                                                                                                                                                                                                                                                                                                                                 |

## Constants

### SHAPE_NORMAL_LEFT

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

```
const val SHAPE_NORMAL_LEFT = 5: Int
```

Regular left turn, from 45 (included) to 135 (excluded) degrees.  

### SHAPE_NORMAL_RIGHT

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

```
const val SHAPE_NORMAL_RIGHT = 6: Int
```

Regular right turn, from 45 (included) to 135 (excluded) degrees.  

### SHAPE_SHARP_LEFT

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

```
const val SHAPE_SHARP_LEFT = 7: Int
```

Sharp left turn, from 135 (included) to 175 (excluded) degrees.  

### SHAPE_SHARP_RIGHT

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

```
const val SHAPE_SHARP_RIGHT = 8: Int
```

Sharp right turn, from 135 (included) to 175 (excluded) degrees.  

### SHAPE_SLIGHT_LEFT

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

```
const val SHAPE_SLIGHT_LEFT = 3: Int
```

Slight left turn, from 10 (included) to 45 (excluded) degrees.  

### SHAPE_SLIGHT_RIGHT

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

```
const val SHAPE_SLIGHT_RIGHT = 4: Int
```

Slight right turn, from 10 (included) to 45 (excluded) degrees.  

### SHAPE_STRAIGHT

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

```
const val SHAPE_STRAIGHT = 2: Int
```

No turn.  

### SHAPE_UNKNOWN

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

```
const val SHAPE_UNKNOWN = 1: Int
```

The shape is unknown, in which case no lane information should be shown.  

### SHAPE_U_TURN_LEFT

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

```
const val SHAPE_U_TURN_LEFT = 9: Int
```

A left turn onto the opposite side of the same street, from 175 (included) to 180 (included) degrees  

### SHAPE_U_TURN_RIGHT

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

```
const val SHAPE_U_TURN_RIGHT = 10: Int
```

A right turn onto the opposite side of the same street, from 175 (included) to 180 (included) degrees  

## Public functions

### create

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

```
java-static fun create(shape: Int, isRecommended: Boolean): LaneDirection
```

Constructs a new instance of a[LaneDirection](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/LaneDirection).  

|                                              Parameters                                              |
|------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `shape: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                 | one of the`SHAPE_*`static constants defined in this class                                                                                                                                                      |
| `isRecommended: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | indicates whether the[LaneDirection](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/LaneDirection)is the one the driver should take in order to stay on the navigation route |

### equals

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

### getShape

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

```
fun getShape(): Int
```

Returns shape of this lane direction.  

### hashCode

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

### isRecommended

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

```
fun isRecommended(): Boolean
```

Returns whether this is a direction the driver should take in order to stay on the navigation route.  

### toString

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