# Direction

# Direction

Artifact:[androidx.test.uiautomator:uiautomator](https://developer.android.com/jetpack/androidx/releases/test-uiautomator)  
[View Source](https://cs.android.com/search?q=file:androidx/test/uiautomator/Direction.java+class:androidx.test.uiautomator.Direction)  
Added in[2.2.0](https://developer.android.com/jetpack/androidx/releases/test-uiautomator#2.2.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/test/uiautomator/Direction "View this page in Java")

<br />

```
enum Direction
```

<br />

*** ** * ** ***

An enumeration used to specify the primary direction of certain gestures.

## Summary

|                                          ### Enum Values                                          |
|---------------------------------------------------------------------------------------------------|---|
| [DOWN](https://developer.android.com/reference/kotlin/androidx/test/uiautomator/Direction#DOWN)   |   |
| [LEFT](https://developer.android.com/reference/kotlin/androidx/test/uiautomator/Direction#LEFT)   |   |
| [RIGHT](https://developer.android.com/reference/kotlin/androidx/test/uiautomator/Direction#RIGHT) |   |
| [UP](https://developer.android.com/reference/kotlin/androidx/test/uiautomator/Direction#UP)       |   |

|                                                                                         ### Public functions                                                                                         |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `java-static `[Direction](https://developer.android.com/reference/kotlin/androidx/test/uiautomator/Direction)                                                                                        | [reverse](https://developer.android.com/reference/kotlin/androidx/test/uiautomator/Direction#reverse(androidx.test.uiautomator.Direction))`(direction: `[Direction](https://developer.android.com/reference/kotlin/androidx/test/uiautomator/Direction)`)` Returns the reverse of the given direction. |
| `java-static `[Direction](https://developer.android.com/reference/kotlin/androidx/test/uiautomator/Direction)`!`                                                                                     | [valueOf](https://developer.android.com/reference/kotlin/androidx/test/uiautomator/Direction#valueOf(java.lang.String))`(name: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!)` Returns the enum constant of this type with the specified name.                  |
| `java-static `[Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[Direction](https://developer.android.com/reference/kotlin/androidx/test/uiautomator/Direction)`!>!` | [values](https://developer.android.com/reference/kotlin/androidx/test/uiautomator/Direction#values())`()` Returns an array containing the constants of this enum type, in the order they're declared.                                                                                                  |

## Enum Values

### DOWN

```
val Direction.DOWN: Direction
```  

### LEFT

```
val Direction.LEFT: Direction
```  

### RIGHT

```
val Direction.RIGHT: Direction
```  

### UP

```
val Direction.UP: Direction
```  

## Public functions

### reverse

Added in[2.2.0](https://developer.android.com/jetpack/androidx/releases/test-uiautomator#2.2.0)  

```
java-static fun reverse(direction: Direction): Direction
```

Returns the reverse of the given direction.  

### valueOf

Added in 2.2.0  

```
java-static fun valueOf(name: String!): Direction!
```

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)  

|                                              Returns                                               |
|----------------------------------------------------------------------------------------------------|-------------------------------------------|
| [Direction](https://developer.android.com/reference/kotlin/androidx/test/uiautomator/Direction)`!` | the enum constant with the specified name |

|                                                        Throws                                                         |
|-----------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------|
| [java.lang.IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException.html) | if this enum type has no constant with the specified name |

### values

Added in 2.2.0  

```
java-static fun values(): Array<Direction!>!
```

Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants.  

|                                                                                        Returns                                                                                         |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|
| [Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[Direction](https://developer.android.com/reference/kotlin/androidx/test/uiautomator/Direction)`!>!` | an array containing the constants of this enum type, in the order they're declared |