Most visited

Recently visited

Added in API level 24

Notification.DecoratedCustomViewStyle

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();
 

Summary

Inherited fields

From class android.app.Notification.Style

Public constructors

Notification.DecoratedCustomViewStyle()

Inherited methods

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

Public constructors

Notification.DecoratedCustomViewStyle

Added in API level 24
Notification.DecoratedCustomViewStyle ()

Hooray!