# NotificationCompat.DecoratedMediaCustomViewStyle

Artifact: [androidx.media:media](https://developer.android.com/jetpack/androidx/releases/media) [View Source](https://cs.android.com/search?q=file:androidx/media/app/NotificationCompat.java+class:androidx.media.app.NotificationCompat.DecoratedMediaCustomViewStyle) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

*** ** * ** ***


```
public class NotificationCompat.DecoratedMediaCustomViewStyle extends NotificationCompat.MediaStyle
```

<br />

|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||||
| ↳ | [androidx.core.app.NotificationCompat.Style](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Style) |||
|   | ↳ | [androidx.media.app.NotificationCompat.MediaStyle](https://developer.android.com/reference/androidx/media/app/NotificationCompat.MediaStyle) ||
|   |   | ↳ | [androidx.media.app.NotificationCompat.DecoratedMediaCustomViewStyle](https://developer.android.com/reference/androidx/media/app/NotificationCompat.DecoratedMediaCustomViewStyle) |

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
>
> androidx.media is deprecated. Please migrate to [androidx.media3](https://developer.android.com/media/media3).

Notification style for media custom views that are decorated by the system.

Instead of providing a media notification that is completely custom, a developer can set this style and still obtain system decorations like the notification header with the expand affordance and actions.

Use `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder`, `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder` and `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder` to set the corresponding custom views to display.

To use this style with your Notification, feed it to `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder` like so:

```
Notification noti = new NotificationCompat.Builder()
    .setSmallIcon(R.drawable.ic_stat_player)
    .setLargeIcon(albumArtBitmap))
    .setCustomContentView(contentView)
    .setStyle(new NotificationCompat.DecoratedMediaCustomViewStyle()
         .setMediaSession(mySession))
    .build();
```

If you are using this style, consider using the corresponding styles like `https://developer.android.com/reference/androidx/media/R.style#TextAppearance_Compat_Notification_Media()` or `https://developer.android.com/reference/androidx/media/R.style#TextAppearance_Compat_Notification_Title_Media()` in your custom views in order to get the correct styling on each platform version.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/app/NotificationCompat.DecoratedCustomViewStyle` |   |
| `https://developer.android.com/reference/androidx/media/app/NotificationCompat.MediaStyle` |   |

## Summary

| ### Public constructors |
|---|
| `[DecoratedMediaCustomViewStyle](https://developer.android.com/reference/androidx/media/app/NotificationCompat.DecoratedMediaCustomViewStyle#DecoratedMediaCustomViewStyle())()` **This method is deprecated.** Deprecated in Java |

### Inherited methods

From [androidx.media.app.NotificationCompat.MediaStyle](https://developer.android.com/reference/androidx/media/app/NotificationCompat.MediaStyle) `static https://developer.android.com/reference/android/support/v4/media/session/MediaSessionCompat.Token` `[getMediaSession](https://developer.android.com/reference/androidx/media/app/NotificationCompat.MediaStyle#getMediaSession(android.app.Notification))(https://developer.android.com/reference/android/app/Notification.html notification)`

**This method is deprecated.** Deprecated in Java
`https://developer.android.com/reference/androidx/media/app/NotificationCompat.MediaStyle` `[setCancelButtonIntent](https://developer.android.com/reference/androidx/media/app/NotificationCompat.MediaStyle#setCancelButtonIntent(android.app.PendingIntent))(https://developer.android.com/reference/android/app/PendingIntent.html pendingIntent)`

**This method is deprecated.** Deprecated in Java
`https://developer.android.com/reference/androidx/media/app/NotificationCompat.MediaStyle` `[setMediaSession](https://developer.android.com/reference/androidx/media/app/NotificationCompat.MediaStyle#setMediaSession(android.support.v4.media.session.MediaSessionCompat.Token))(https://developer.android.com/reference/android/support/v4/media/session/MediaSessionCompat.Token token)`

**This method is deprecated.** Deprecated in Java
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/media/app/NotificationCompat.MediaStyle` `@https://developer.android.com/reference/androidx/annotation/RequiresPermission(value = "android.permission.MEDIA_CONTENT_CONTROL")
[setRemotePlaybackInfo](https://developer.android.com/reference/androidx/media/app/NotificationCompat.MediaStyle#setRemotePlaybackInfo(java.lang.CharSequence,int,android.app.PendingIntent))(
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/CharSequence.html deviceName,
@https://developer.android.com/reference/androidx/annotation/DrawableRes int iconResource,
@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/app/PendingIntent.html chipIntent
)`

**This method is deprecated.** Deprecated in Java
`https://developer.android.com/reference/androidx/media/app/NotificationCompat.MediaStyle` `[setShowActionsInCompactView](https://developer.android.com/reference/androidx/media/app/NotificationCompat.MediaStyle#setShowActionsInCompactView(int...))(int[] actions)`

**This method is deprecated.** Deprecated in Java
`https://developer.android.com/reference/androidx/media/app/NotificationCompat.MediaStyle` `[setShowCancelButton](https://developer.android.com/reference/androidx/media/app/NotificationCompat.MediaStyle#setShowCancelButton(boolean))(boolean show)`

**This method is deprecated.** Deprecated in Java
From [androidx.core.app.NotificationCompat.Style](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Style) `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/app/Notification.html` `[build](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Style#build())()`

**This method is deprecated.** Deprecated in Java
`void` `[setBuilder](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Style#setBuilder(androidx.core.app.NotificationCompat.Builder))(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder builder)`

**This method is deprecated.** Deprecated in Java

## Public constructors

### DecoratedMediaCustomViewStyle

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

```
public [DecoratedMediaCustomViewStyle](https://developer.android.com/reference/androidx/media/app/NotificationCompat.DecoratedMediaCustomViewStyle#DecoratedMediaCustomViewStyle())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java