public static class Notification.DecoratedCustomViewStyle
extends Notification.Style
| java.lang.Object | ||
| android.app.Notification.Style | ||
| android.app.Notification.DecoratedCustomViewStyle | ||
由系统装饰的自定义视图的通知样式
开发人员可以设置此风格,而不是提供完全自定义的通知,而是通过展开可供件和动作来获取系统装饰,例如通知标题。
使用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.DecoratedCustomViewStyle())
.build();
Inherited fields |
|---|
android.app.Notification.Style
|
Public constructors |
|
|---|---|
Notification.DecoratedCustomViewStyle() |
|
继承方法(Inherited methods) |
|
|---|---|
android.app.Notification.Style
|
|
java.lang.Object
|
|
Notification.DecoratedCustomViewStyle ()