Most visited

Recently visited

Added in API level 24

Notification.DecoratedMediaCustomViewStyle

public static class Notification.DecoratedMediaCustomViewStyle
extends Notification.MediaStyle

java.lang.Object
   ↳ android.app.Notification.Style
     ↳ android.app.Notification.MediaStyle
       ↳ android.app.Notification.DecoratedMediaCustomViewStyle


媒体自定义视图的通知样式,由系统修饰

开发人员可以设置此风格,而不是提供完全自定义的媒体通知,而是通过扩展可供件和动作来获取系统装饰,例如通知标题。

使用setCustomContentView(RemoteViews)setCustomBigContentView(RemoteViews)setCustomHeadsUpContentView(RemoteViews)设置相应的自定义视图来显示。 要在您的通知中使用此样式,请按setStyle(android.app.Notification.Style)所示将它提供给setStyle(android.app.Notification.Style)

 Notification noti = new Notification.Builder()
     .setSmallIcon(R.drawable.ic_stat_player)
     .setLargeIcon(albumArtBitmap))
     .setCustomContentView(contentView);
     .setStyle(new Notification.DecoratedMediaCustomViewStyle()
          .setMediaSession(mySession))
     .build();
 

也可以看看:

Summary

Inherited fields

From class android.app.Notification.Style

Public constructors

Notification.DecoratedMediaCustomViewStyle()

Inherited methods

From class android.app.Notification.MediaStyle
From class android.app.Notification.Style
From class java.lang.Object

Public constructors

Notification.DecoratedMediaCustomViewStyle

Added in API level 24
Notification.DecoratedMediaCustomViewStyle ()

Hooray!