# AspectRatioFrameLayout.AspectRatioListener

Artifact: [androidx.media3:media3-ui](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/ui/AspectRatioFrameLayout.java+class:androidx.media3.ui.AspectRatioFrameLayout.AspectRatioListener)

*** ** * ** ***


```
public interface AspectRatioFrameLayout.AspectRatioListener
```

<br />

*** ** * ** ***

Listener to be notified about changes of the aspect ratios of this view.

## Summary

| ### Public methods |
|---|---|
| `abstract void` | `https://developer.android.com/reference/androidx/media3/ui/AspectRatioFrameLayout.AspectRatioListener#onAspectRatioUpdated(float,float,boolean)( float targetAspectRatio, float naturalAspectRatio, boolean aspectRatioMismatch )` Called when either the target aspect ratio or the view aspect ratio is updated. |

## Public methods

### onAspectRatioUpdated

```
abstract void onAspectRatioUpdated(
    float targetAspectRatio,
    float naturalAspectRatio,
    boolean aspectRatioMismatch
)
```

Called when either the target aspect ratio or the view aspect ratio is updated.

| Parameters |
|---|---|
| `float targetAspectRatio` | The aspect ratio that has been set in `https://developer.android.com/reference/androidx/media3/ui/AspectRatioFrameLayout#setAspectRatio(float)` |
| `float naturalAspectRatio` | The natural aspect ratio of this view (before its width and height are modified to satisfy the target aspect ratio). |
| `boolean aspectRatioMismatch` | Whether the target and natural aspect ratios differ enough for changing the resize mode to have an effect. |