# DeviceController.ScreenOrientation

# DeviceController.ScreenOrientation

Artifact:[androidx.test:monitor](https://developer.android.com/jetpack/androidx/releases/test)  
[View Source](https://cs.android.com/search?q=file:androidx/test/platform/device/DeviceController.java+class:androidx.test.platform.device.DeviceController.ScreenOrientation)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/test/platform/device/DeviceController.ScreenOrientation "View this page in Java")

<br />

```
enum DeviceController.ScreenOrientation
```

<br />

*** ** * ** ***

Enum for screen orientations a device can be set to.

## Summary

|                                                            ### Enum Values                                                             |
|----------------------------------------------------------------------------------------------------------------------------------------|---|
| [LANDSCAPE](https://developer.android.com/reference/kotlin/androidx/test/platform/device/DeviceController.ScreenOrientation#LANDSCAPE) |   |
| [PORTRAIT](https://developer.android.com/reference/kotlin/androidx/test/platform/device/DeviceController.ScreenOrientation#PORTRAIT)   |   |

|                                                                                                                    ### Public functions                                                                                                                    |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `java-static `[DeviceController.ScreenOrientation](https://developer.android.com/reference/kotlin/androidx/test/platform/device/DeviceController.ScreenOrientation)`!`                                                                                     | [valueOf](https://developer.android.com/reference/kotlin/androidx/test/platform/device/DeviceController.ScreenOrientation#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)`<`[DeviceController.ScreenOrientation](https://developer.android.com/reference/kotlin/androidx/test/platform/device/DeviceController.ScreenOrientation)`!>!` | [values](https://developer.android.com/reference/kotlin/androidx/test/platform/device/DeviceController.ScreenOrientation#values())`()` Returns an array containing the constants of this enum type, in the order they're declared.                                                                                 |

## Enum Values

### LANDSCAPE

```
val DeviceController.ScreenOrientation.LANDSCAPE: DeviceController.ScreenOrientation
```  

### PORTRAIT

```
val DeviceController.ScreenOrientation.PORTRAIT: DeviceController.ScreenOrientation
```  

## Public functions

### valueOf

```
java-static fun valueOf(name: String!): DeviceController.ScreenOrientation!
```

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                                                                          |
|----------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------|
| [DeviceController.ScreenOrientation](https://developer.android.com/reference/kotlin/androidx/test/platform/device/DeviceController.ScreenOrientation)`!` | 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

```
java-static fun values(): Array<DeviceController.ScreenOrientation!>!
```

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)`<`[DeviceController.ScreenOrientation](https://developer.android.com/reference/kotlin/androidx/test/platform/device/DeviceController.ScreenOrientation)`!>!` | an array containing the constants of this enum type, in the order they're declared |