# RotationProvider.Listener

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/RotationProvider.java+class:androidx.camera.view.RotationProvider.Listener) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/camera#1.1.0)

*** ** * ** ***


```
interface RotationProvider.Listener
```

<br />

*** ** * ** ***

Callback interface to receive rotation updates.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/view/RotationProvider.Listener#onRotationChanged(int)(rotation: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Called when the physical rotation of the device changes. |

## Public functions

### onRotationChanged

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/camera#1.1.0)

```
fun onRotationChanged(rotation: Int): Unit
```

Called when the physical rotation of the device changes.

The rotation is one of the `https://developer.android.com/reference/android/view/Surface.html` rotations mapped from orientation degrees.

| Orientation degrees | Surface rotation |
|---|---|
| \[-45°, 45°) | `https://developer.android.com/reference/android/view/Surface.html#ROTATION_0` |
| \[45°, 135°) | `https://developer.android.com/reference/android/view/Surface.html#ROTATION_270` |
| \[135°, 225°) | `https://developer.android.com/reference/android/view/Surface.html#ROTATION_180` |
| \[225°, 315°) | `https://developer.android.com/reference/android/view/Surface.html#ROTATION_90` |