public static class Notification.DecoratedMediaCustomViewStyle extends Notification.MediaStyle
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 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
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(new Notification.DecoratedMediaCustomViewStyle() .setMediaSession(mySession)) .build();
mBuilder, mSummaryText, mSummaryTextSet
Constructor and Description |
---|
DecoratedMediaCustomViewStyle() |
Modifier and Type | Method and Description |
---|---|
boolean |
displayCustomViewInline() |
RemoteViews |
makeBigContentView()
Construct a Style-specific RemoteViews for the final big notification layout.
|
RemoteViews |
makeContentView()
Construct a Style-specific RemoteViews for the final 1U notification layout.
|
RemoteViews |
makeHeadsUpContentView()
Construct a Style-specific RemoteViews for the final HUN layout.
|
addExtras, buildStyled, hasProgress, restoreFromExtras, setMediaSession, setShowActionsInCompactView
build, checkBuilder, getStandardView, hasSummaryInHeader, internalSetBigContentTitle, internalSetSummaryText, purgeResources, setBuilder
public boolean displayCustomViewInline()
displayCustomViewInline
in class Notification.Style
public RemoteViews makeContentView()
Notification.Style
makeContentView
in class Notification.MediaStyle
public RemoteViews makeBigContentView()
Notification.Style
makeBigContentView
in class Notification.MediaStyle
public RemoteViews makeHeadsUpContentView()
Notification.Style
makeHeadsUpContentView
in class Notification.MediaStyle