belongs to Maven artifact com.android.support:support-media-compat:28.0.0-alpha1
NotificationCompat.DecoratedMediaCustomViewStyle
public
static
class
NotificationCompat.DecoratedMediaCustomViewStyle
extends NotificationCompat.MediaStyle
| java.lang.Object | |||
| ↳ | android.support.v4.app.NotificationCompat.Style | ||
| ↳ | android.support.v4.media.app.NotificationCompat.MediaStyle | ||
| ↳ | android.support.v4.media.app.NotificationCompat.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 #setCustomContentView(RemoteViews),
#setCustomBigContentView(RemoteViews) and
#setCustomHeadsUpContentView(RemoteViews) to set the
corresponding custom views to display.
To use this style with your Notification, feed it to
#setStyle(android.support.v4.app.NotificationCompat.Style) like so:
Notification noti = new NotificationCompat.Builder()
.setSmallIcon(R.drawable.ic_stat_player)
.setLargeIcon(albumArtBitmap))
.setCustomContentView(contentView)
.setStyle(new NotificationCompat.DecoratedMediaCustomViewStyle()
.setMediaSession(mySession))
.build();
If you are using this style, consider using the corresponding styles like
TextAppearance_Compat_Notification_Media or
TextAppearance_Compat_Notification_Title_Media in
your custom views in order to get the correct styling on each platform version.
Summary
Public constructors | |
|---|---|
NotificationCompat.DecoratedMediaCustomViewStyle()
|
|
Inherited methods | |
|---|---|
android.support.v4.media.app.NotificationCompat.MediaStyle
| |
android.support.v4.app.NotificationCompat.Style
| |
java.lang.Object
| |
Public constructors
NotificationCompat.DecoratedMediaCustomViewStyle
NotificationCompat.DecoratedMediaCustomViewStyle ()