# NotificationCompat.DecoratedCustomViewStyle

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

*** ** * ** ***


```
class NotificationCompat.DecoratedCustomViewStyle : NotificationCompat.Style
```

<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.core.app.NotificationCompat.DecoratedCustomViewStyle](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.DecoratedCustomViewStyle) |

*** ** * ** ***

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

Instead of providing a 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#setCustomContentView(android.widget.RemoteViews)`, `https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Builder#setCustomBigContentView(android.widget.RemoteViews)` and `https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Builder#setCustomHeadsUpContentView(android.widget.RemoteViews)` 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#setStyle(androidx.core.app.NotificationCompat.Style)` like so:

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

If you are using this style, consider using the corresponding styles like or in your custom views in order to get the correct styling on each platform version.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.DecoratedCustomViewStyle#DecoratedCustomViewStyle()()` |

| ### Public functions |
|---|---|
| `java-static (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html!>` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi(value = 24) https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.DecoratedCustomViewStyle#getTextsFromContentView(android.content.Context,android.app.Notification)(context: https://developer.android.com/reference/android/content/Context.html, notification: https://developer.android.com/reference/android/app/Notification.html)` A helper method to get texts from a `https://developer.android.com/reference/android/app/Notification.html`'s custom content view made by either `https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Builder#setCustomBigContentView(android.widget.RemoteViews)`, `https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Builder#setCustomContentView(android.widget.RemoteViews)` or `https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Builder#setCustomHeadsUpContentView(android.widget.RemoteViews)`. |

### Inherited functions

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

### DecoratedCustomViewStyle

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

```
DecoratedCustomViewStyle()
```

## Public functions

### getTextsFromContentView

Added in [1.15.0](https://developer.android.com/jetpack/androidx/releases/core#1.15.0)

```
@RequiresApi(value = 24)
java-static fun getTextsFromContentView(context: Context, notification: Notification): (Mutable)List<CharSequence!>
```

A helper method to get texts from a `https://developer.android.com/reference/android/app/Notification.html`'s custom content view made by either `https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Builder#setCustomBigContentView(android.widget.RemoteViews)`, `https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Builder#setCustomContentView(android.widget.RemoteViews)` or `https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Builder#setCustomHeadsUpContentView(android.widget.RemoteViews)`. Note that this method will not look for `https://developer.android.com/reference/android/app/Notification.html#publicVersion` made by `https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Builder#setPublicVersion(android.app.Notification)`.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html` | A `https://developer.android.com/reference/android/content/Context.html` that will be used to inflate the content view from the notification. |
| `notification: https://developer.android.com/reference/android/app/Notification.html` | The notification from which to get texts from its content view. |

| Returns |
|---|---|
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html!>` | A list of text from the notification custom content view made by the above method. Note that the method only returns a list of text from one of the custom view as the above when it set, meaning when multiple custom content views has set in a notification, the returned list will base on the detail of custom content and usage as the priority: First is `https://developer.android.com/reference/android/app/Notification.html#bigContentView`, then is `https://developer.android.com/reference/android/app/Notification.html#contentView` when no big content view has set, or `https://developer.android.com/reference/android/app/Notification.html#headsUpContentView` when set. Otherwise, returns the empty list. |