# 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)

*** ** * ** ***


```
class MediaStyleNotificationHelper.DecoratedMediaCustomViewStyle : MediaStyleNotificationHelper.MediaStyle
```

<br />

|---|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) ||||
| ↳ | [androidx.core.app.NotificationCompat.Style](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Style) |||
|   | ↳ | [androidx.media3.session.MediaStyleNotificationHelper.MediaStyle](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaStyleNotificationHelper.MediaStyle) ||
|   |   | ↳ | [androidx.media3.session.MediaStyleNotificationHelper.DecoratedMediaCustomViewStyle](https://developer.android.com/reference/kotlin/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/kotlin/androidx/core/app/NotificationCompat.Builder`, `https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Builder` and `https://developer.android.com/reference/kotlin/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/kotlin/androidx/core/app/NotificationCompat.Builder` like so:

```kotlin
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/kotlin/androidx/core/app/NotificationCompat.DecoratedCustomViewStyle` |   |
| `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaStyleNotificationHelper.MediaStyle` |   |

## Summary

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

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaStyleNotificationHelper.DecoratedMediaCustomViewStyle#apply(androidx.core.app.NotificationBuilderWithBuilderAccessor)(builder: https://developer.android.com/reference/kotlin/androidx/core/app/NotificationBuilderWithBuilderAccessor!)` Applies the compat style data to the framework `https://developer.android.com/reference/android/app/Notification.html` in a backwards compatible way. |

### Inherited functions

From [androidx.media3.session.MediaStyleNotificationHelper.MediaStyle](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaStyleNotificationHelper.MediaStyle) `java-static https://developer.android.com/reference/kotlin/androidx/media3/session/SessionToken?` `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaStyleNotificationHelper.MediaStyle#getSessionToken(android.app.Notification)(notification: https://developer.android.com/reference/android/app/Notification.html!)`

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

**This function is deprecated.**

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

<br />

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

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/kotlin/androidx/media3/session/MediaStyleNotificationHelper.MediaStyle!` `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html
https://developer.android.com/reference/kotlin/androidx/media3/session/MediaStyleNotificationHelper.MediaStyle#setShowActionsInCompactView(int...)(actions: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!)`

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/kotlin/androidx/media3/session/MediaStyleNotificationHelper.MediaStyle!` `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html
[setShowCancelButton](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaStyleNotificationHelper.MediaStyle#setShowCancelButton(boolean))(show: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

**This function 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/kotlin/androidx/core/app/NotificationCompat.Style) `https://developer.android.com/reference/android/app/Notification.html?` `https://developer.android.com/reference/kotlin/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.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Style#setBuilder(androidx.core.app.NotificationCompat.Builder)(builder: https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Builder?)`

Link this rich notification style with a notification builder.

## Public constructors

### DecoratedMediaCustomViewStyle

```
DecoratedMediaCustomViewStyle(session: MediaSession!)
```

## Public functions

### apply

```
fun apply(builder: NotificationBuilderWithBuilderAccessor!): Unit
```

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.