Stay organized with collections
Save and categorize content based on your preferences.
DecoratedCustomViewStyle
open class DecoratedCustomViewStyle : Notification.Style
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 android.app.Notification.Builder#setCustomContentView(RemoteViews)
, android.app.Notification.Builder#setCustomBigContentView(RemoteViews)
and android.app.Notification.Builder#setCustomHeadsUpContentView(RemoteViews)
to set the corresponding custom views to display.
To use this style with your Notification, feed it to Notification.Builder.setStyle(android.app.Notification.Style)
like so:
Notification noti = new Notification.Builder()
.setSmallIcon(R.drawable.ic_stat_player)
.setLargeIcon(albumArtBitmap))
.setCustomContentView(contentView);
.setStyle(<b>new Notification.DecoratedCustomViewStyle()</b>)
.build();
Summary
Public constructors
DecoratedCustomViewStyle
DecoratedCustomViewStyle()
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-20 UTC."],[],[],null,["# Notification.DecoratedCustomViewStyle\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nDecoratedCustomViewStyle\n========================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/app/Notification.DecoratedCustomViewStyle \"View this page in Java\") \n\n```\nopen class DecoratedCustomViewStyle : Notification.Style\n```\n\n|---|---|--------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||\n| ↳ | [android.app.Notification.Style](/reference/kotlin/android/app/Notification.Style) ||\n| | ↳ | [android.app.Notification.DecoratedCustomViewStyle](#) |\n\nNotification style for custom views that are decorated by the system\n\nInstead 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.\n\nUse [android.app.Notification.Builder#setCustomContentView(RemoteViews)](/reference/kotlin/android/app/Notification.Builder#setCustomContentView(android.widget.RemoteViews)), [android.app.Notification.Builder#setCustomBigContentView(RemoteViews)](/reference/kotlin/android/app/Notification.Builder#setCustomBigContentView(android.widget.RemoteViews)) and [android.app.Notification.Builder#setCustomHeadsUpContentView(RemoteViews)](/reference/kotlin/android/app/Notification.Builder#setCustomHeadsUpContentView(android.widget.RemoteViews)) to set the corresponding custom views to display.\n\nTo use this style with your Notification, feed it to [Notification.Builder.setStyle(android.app.Notification.Style)](/reference/kotlin/android/app/Notification.Builder#setStyle(android.app.Notification.Style)) like so: \n\n```kotlin\nNotification noti = new Notification.Builder()\n .setSmallIcon(R.drawable.ic_stat_player)\n .setLargeIcon(albumArtBitmap))\n .setCustomContentView(contentView);\n .setStyle(\u003cb\u003enew Notification.DecoratedCustomViewStyle()\u003c/b\u003e)\n .build();\n \n```\n\nSummary\n-------\n\n| Public constructors ||\n|--------------------------------------------------------------------|---|\n| [DecoratedCustomViewStyle](#DecoratedCustomViewStyle())`()` \u003cbr /\u003e |\n\n| Inherited functions ||\n|---|---|\n| From class [Style](/reference/kotlin/android/app/Notification.Style) |------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Notification](/reference/kotlin/android/app/Notification)! | [build](/reference/kotlin/android/app/Notification.Style#build())`()` Calls [android.app.Notification.Builder#build()](/reference/kotlin/android/app/Notification.Builder#build()) on the Builder this Style is attached to. Note: Calling build() multiple times returns the same Notification instance, so reusing a builder to create multiple Notifications is discouraged. \u003cbr /\u003e | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [checkBuilder](/reference/kotlin/android/app/Notification.Style#checkBuilder())`()` \u003cbr /\u003e | | [RemoteViews](../widget/RemoteViews.html#)! | [getStandardView](/reference/kotlin/android/app/Notification.Style#getStandardView(kotlin.Int))`(`layoutId:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` \u003cbr /\u003e | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [internalSetBigContentTitle](/reference/kotlin/android/app/Notification.Style#internalSetBigContentTitle(kotlin.CharSequence))`(`title:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!`)` Overrides ContentTitle in the expanded form of the template. This defaults to the value passed to setContentTitle(). \u003cbr /\u003e | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [internalSetSummaryText](/reference/kotlin/android/app/Notification.Style#internalSetSummaryText(kotlin.CharSequence))`(`cs:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!`)` Set the first line of text after the detail section in the expanded form of the template. \u003cbr /\u003e | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [setBuilder](/reference/kotlin/android/app/Notification.Style#setBuilder(android.app.Notification.Builder))`(`builder:` `[Notification.Builder](/reference/kotlin/android/app/Notification.Builder)!`)` \u003cbr /\u003e | ||\n\n| Inherited properties ||\n|---|---|\n| From class [Style](/reference/kotlin/android/app/Notification.Style) |-----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------| | [Notification.Builder](/reference/kotlin/android/app/Notification.Builder)! | [mBuilder](/reference/kotlin/android/app/Notification.Style#mBuilder:android.app.Notification.Builder) \u003cbr /\u003e | ||\n\nPublic constructors\n-------------------\n\n### DecoratedCustomViewStyle\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nDecoratedCustomViewStyle()\n```"]]