public static class NotificationCompat.DecoratedCustomViewStyle extends NotificationCompat.Style
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 Notification.Builder.setCustomContentView(RemoteViews)
,
Notification.Builder.setCustomBigContentView(RemoteViews)
and
Notification.Builder.setCustomHeadsUpContentView(RemoteViews)
to set the
corresponding custom views to display.
To use this style with your Notification, feed it to
NotificationCompat.Builder#setStyle(Style)
like so:
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
android.support.v7.appcompat.R.style#TextAppearance_AppCompat_Notification
or
android.support.v7.appcompat.R.style#TextAppearance_AppCompat_Notification_Title
in
your custom views in order to get the correct styling on each platform version.
Constructor and Description |
---|
DecoratedCustomViewStyle() |
addCompatExtras, build, restoreFromCompatExtras, setBuilder