# MediaStyleNotificationHelper.DecoratedMediaCustomViewStyle

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

*** ** * ** ***


```
public class MediaStyleNotificationHelper.DecoratedMediaCustomViewStyle extends MediaStyleNotificationHelper.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.media3.session.MediaStyleNotificationHelper.MediaStyle](https://developer.android.com/reference/androidx/media3/session/MediaStyleNotificationHelper.MediaStyle) ||
|   |   | ↳ | [androidx.media3.session.MediaStyleNotificationHelper.DecoratedMediaCustomViewStyle](https://developer.android.com/reference/androidx/media3/session/MediaStyleNotificationHelper.DecoratedMediaCustomViewStyle) |

*** ** * ** ***

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(androidx.media3.R.drawable.media3_notification_small_icon)
    .setLargeIcon(albumArtBitmap))
    .setCustomContentView(contentView)
    .setStyle(new NotificationCompat.DecoratedMediaCustomViewStyle()
         .setMediaSession(mySession))
    .build();
```

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

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/session/MediaStyleNotificationHelper.DecoratedMediaCustomViewStyle#DecoratedMediaCustomViewStyle(androidx.media3.session.MediaSession)(https://developer.android.com/reference/androidx/media3/session/MediaSession session)` |

| ### Public methods |
|---|---|
| `void` | `https://developer.android.com/reference/androidx/media3/session/MediaStyleNotificationHelper.DecoratedMediaCustomViewStyle#apply(androidx.core.app.NotificationBuilderWithBuilderAccessor)(https://developer.android.com/reference/androidx/core/app/NotificationBuilderWithBuilderAccessor builder)` Applies the compat style data to the framework `https://developer.android.com/reference/android/app/Notification.html` in a backwards compatible way. |

### Inherited methods

From [androidx.media3.session.MediaStyleNotificationHelper.MediaStyle](https://developer.android.com/reference/androidx/media3/session/MediaStyleNotificationHelper.MediaStyle) `static @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/session/SessionToken` `https://developer.android.com/reference/androidx/media3/session/MediaStyleNotificationHelper.MediaStyle#getSessionToken(android.app.Notification)(https://developer.android.com/reference/android/app/Notification.html notification)`

Extracts a `https://developer.android.com/reference/androidx/media3/session/SessionToken` from the extra values in the `https://developer.android.com/reference/androidx/media3/session/MediaStyleNotificationHelper.MediaStyle``https://developer.android.com/reference/android/app/Notification.html`.
`https://developer.android.com/reference/androidx/media3/session/MediaStyleNotificationHelper.MediaStyle` `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html
[setCancelButtonIntent](https://developer.android.com/reference/androidx/media3/session/MediaStyleNotificationHelper.MediaStyle#setCancelButtonIntent(android.app.PendingIntent))(https://developer.android.com/reference/android/app/PendingIntent.html pendingIntent)`

**This method is deprecated.**

This method is a no-op and usages can be safely removed.

<br />

`https://developer.android.com/reference/androidx/media3/session/MediaStyleNotificationHelper.MediaStyle` `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html
@https://developer.android.com/reference/androidx/annotation/RequiresPermission(value = "android.permission.MEDIA_CONTENT_CONTROL")
https://developer.android.com/reference/androidx/media3/session/MediaStyleNotificationHelper.MediaStyle#setRemotePlaybackInfo(java.lang.CharSequence,int,android.app.PendingIntent)(
https://developer.android.com/reference/java/lang/CharSequence.html deviceName,
@https://developer.android.com/reference/androidx/annotation/DrawableRes int iconResource,
@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/app/PendingIntent.html chipIntent
)`

For media notifications associated with playback on a remote device, provide device information that will replace the default values for the output switcher chip on the media control, as well as an intent to use when the output switcher chip is tapped, on devices where this is supported.
`https://developer.android.com/reference/androidx/media3/session/MediaStyleNotificationHelper.MediaStyle` `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html
https://developer.android.com/reference/androidx/media3/session/MediaStyleNotificationHelper.MediaStyle#setShowActionsInCompactView(int...)(int[] actions)`

Requests up to 3 actions (by index in the order of addition) to be shown in the compact notification view.
`https://developer.android.com/reference/androidx/media3/session/MediaStyleNotificationHelper.MediaStyle` `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html
[setShowCancelButton](https://developer.android.com/reference/androidx/media3/session/MediaStyleNotificationHelper.MediaStyle#setShowCancelButton(boolean))(boolean show)`

**This method is deprecated.**

This method is a no-op and usages can be safely removed.

<br />

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` `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Style#build()()`

If this Style object has been set on a notification builder, this method will build that notification and return it.
`void` `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)`

Link this rich notification style with a notification builder.

## Public constructors

### DecoratedMediaCustomViewStyle

```
public DecoratedMediaCustomViewStyle(MediaSession session)
```

## Public methods

### apply

```
public void apply(NotificationBuilderWithBuilderAccessor builder)
```

Applies the compat style data to the framework `https://developer.android.com/reference/android/app/Notification.html` in a backwards compatible way. All other data should be stored within the Notification's extras.