# PreviewView.StreamState

Artifact: [androidx.camera:camera-view](https://developer.android.com/jetpack/androidx/releases/camera) [View Source](https://cs.android.com/search?q=file:androidx/camera/view/PreviewView.java+class:androidx.camera.view.PreviewView.StreamState) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/camera#1.1.0)

*** ** * ** ***


```
enum PreviewView.StreamState
```

<br />

*** ** * ** ***

Definitions for the preview stream state.

## Summary

| ### Enum Values |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/view/PreviewView.StreamState#IDLE` | Preview is not visible yet. |
| `https://developer.android.com/reference/kotlin/androidx/camera/view/PreviewView.StreamState#STREAMING` | Preview is streaming. |

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

## Enum Values

### IDLE

```
val PreviewView.StreamState.IDLE: PreviewView.StreamState
```

Preview is not visible yet.

### STREAMING

```
val PreviewView.StreamState.STREAMING: PreviewView.StreamState
```

Preview is streaming.

This state only guarantees the preview is streaming when the implementation mode is `https://developer.android.com/reference/kotlin/androidx/camera/view/PreviewView.ImplementationMode#COMPATIBLE`. When in `https://developer.android.com/reference/kotlin/androidx/camera/view/PreviewView.ImplementationMode#PERFORMANCE` mode, it is possible that the preview becomes visible slightly after the state has changed. For apps requiring a precise signal for when the preview starts, please set `https://developer.android.com/reference/kotlin/androidx/camera/view/PreviewView.ImplementationMode#COMPATIBLE` mode via `https://developer.android.com/reference/kotlin/androidx/camera/view/PreviewView#setImplementationMode(androidx.camera.view.PreviewView.ImplementationMode)`.

## Public functions

### valueOf

Added in 1.1.0

```
java-static fun valueOf(name: String!): PreviewView.StreamState!
```

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 |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/view/PreviewView.StreamState!` | the enum constant with the specified name |

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

### values

Added in 1.1.0

```
java-static fun values(): Array<PreviewView.StreamState!>!
```

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 |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/camera/view/PreviewView.StreamState!>!` | an array containing the constants of this enum type, in the order they're declared |