NotificationCompat.DecoratedMediaCustomViewStyle

Added in 1.1.0
Deprecated in 1.8.0

public class NotificationCompat.DecoratedMediaCustomViewStyle extends NotificationCompat.MediaStyle


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(androidx.core.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

This method is deprecated. Deprecated in Java

Inherited methods

From androidx.media.app.NotificationCompat.MediaStyle
static MediaSessionCompat.Token

This method is deprecated. Deprecated in Java

NotificationCompat.MediaStyle

This method is deprecated. Deprecated in Java

NotificationCompat.MediaStyle

This method is deprecated. Deprecated in Java

@NonNull NotificationCompat.MediaStyle
@RequiresPermission(value = "android.permission.MEDIA_CONTENT_CONTROL")
setRemotePlaybackInfo(
    @NonNull CharSequence deviceName,
    @DrawableRes int iconResource,
    @Nullable PendingIntent chipIntent
)

This method is deprecated. Deprecated in Java

NotificationCompat.MediaStyle

This method is deprecated. Deprecated in Java

NotificationCompat.MediaStyle
setShowCancelButton(boolean show)

This method is deprecated. Deprecated in Java

From androidx.core.app.NotificationCompat.Style
@Nullable Notification

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

Public constructors

DecoratedMediaCustomViewStyle

Added in 1.1.0
Deprecated in 1.8.0
public DecoratedMediaCustomViewStyle()