# AdOverlayInfo

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

*** ** * ** ***


```
public final class AdOverlayInfo
```

<br />

*** ** * ** ***

Provides information about an overlay view shown on top of an ad view group.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/media3/common/AdOverlayInfo.Builder` A builder for `https://developer.android.com/reference/androidx/media3/common/AdOverlayInfo` instances. |
| `@https://developer.android.com/reference/java/lang/annotation/Documented.html @https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE) @https://developer.android.com/reference/java/lang/annotation/Target.html(value = ) @https://developer.android.com/reference/androidx/annotation/IntDef(value = ) public annotation https://developer.android.com/reference/androidx/media3/common/AdOverlayInfo.Purpose` The purpose of the overlay. |

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/AdOverlayInfo#PURPOSE_CLOSE_AD() = 2` Purpose for ad close buttons overlaying the player. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/AdOverlayInfo#PURPOSE_CONTROLS() = 1` Purpose for playback controls overlaying the player. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/AdOverlayInfo#PURPOSE_NOT_VISIBLE() = 4` Purpose for overlays that are not visible. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/AdOverlayInfo#PURPOSE_OTHER() = 3` Purpose for other overlays. |

| ### Public fields |
|---|---|
| `final int` | `@https://developer.android.com/reference/androidx/media3/common/AdOverlayInfo.Purpose https://developer.android.com/reference/androidx/media3/common/AdOverlayInfo#purpose()` The purpose of the overlay view. |
| `final @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/common/AdOverlayInfo#reasonDetail()` An optional, detailed reason that the overlay view is needed. |
| `final https://developer.android.com/reference/android/view/View.html` | `https://developer.android.com/reference/androidx/media3/common/AdOverlayInfo#view()` The overlay view. |

| ### Public constructors |
|---|
| `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi [AdOverlayInfo](https://developer.android.com/reference/androidx/media3/common/AdOverlayInfo#AdOverlayInfo(android.view.View,int))(https://developer.android.com/reference/android/view/View.html view, @https://developer.android.com/reference/androidx/media3/common/AdOverlayInfo.Purpose int purpose)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/media3/common/AdOverlayInfo.Builder` instead. <br /> |
| `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi [AdOverlayInfo](https://developer.android.com/reference/androidx/media3/common/AdOverlayInfo#AdOverlayInfo(android.view.View,int,java.lang.String))( https://developer.android.com/reference/android/view/View.html view, @https://developer.android.com/reference/androidx/media3/common/AdOverlayInfo.Purpose int purpose, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/String.html detailedReason )` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/media3/common/AdOverlayInfo.Builder` instead. <br /> |

## Constants

### PURPOSE_CLOSE_AD

```
public static final int PURPOSE_CLOSE_AD = 2
```

Purpose for ad close buttons overlaying the player.

### PURPOSE_CONTROLS

```
public static final int PURPOSE_CONTROLS = 1
```

Purpose for playback controls overlaying the player.

### PURPOSE_NOT_VISIBLE

```
public static final int PURPOSE_NOT_VISIBLE = 4
```

Purpose for overlays that are not visible.

### PURPOSE_OTHER

```
public static final int PURPOSE_OTHER = 3
```

Purpose for other overlays.

## Public fields

### purpose

```
@AdOverlayInfo.Purpose
public final int purpose
```

The purpose of the overlay view.

### reasonDetail

```
public final @Nullable String reasonDetail
```

An optional, detailed reason that the overlay view is needed.

### view

```
public final View view
```

The overlay view.

## Public constructors

### AdOverlayInfo

```
@UnstableApi
public [AdOverlayInfo](https://developer.android.com/reference/androidx/media3/common/AdOverlayInfo#AdOverlayInfo(android.view.View,int))(View view, @AdOverlayInfo.Purpose int purpose)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/media3/common/AdOverlayInfo.Builder` instead.

### AdOverlayInfo

```
@UnstableApi
public [AdOverlayInfo](https://developer.android.com/reference/androidx/media3/common/AdOverlayInfo#AdOverlayInfo(android.view.View,int,java.lang.String))(
    View view,
    @AdOverlayInfo.Purpose int purpose,
    @Nullable String detailedReason
)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/media3/common/AdOverlayInfo.Builder` instead.