method public android.app.Notification.Builder addExtras(android.os.Bundle);
method public android.app.Notification.Builder addPerson(java.lang.String);
method public android.app.Notification build();
+ method public android.widget.RemoteViews createBigContentView();
+ method public android.widget.RemoteViews createContentView();
+ method public android.widget.RemoteViews createHeadsUpContentView();
method public android.app.Notification.Builder extend(android.app.Notification.Extender);
method public android.os.Bundle getExtras();
method public deprecated android.app.Notification getNotification();
- method public android.widget.RemoteViews makeBigContentView();
- method public android.widget.RemoteViews makeContentView();
- method public android.widget.RemoteViews makeHeadsUpContentView();
method public static android.app.Notification.Builder recoverBuilder(android.content.Context, android.app.Notification);
method public android.app.Notification.Builder setActions(android.app.Notification.Action...);
method public android.app.Notification.Builder setAutoCancel(boolean);
method public android.app.Notification.Builder addExtras(android.os.Bundle);
method public android.app.Notification.Builder addPerson(java.lang.String);
method public android.app.Notification build();
+ method public android.widget.RemoteViews createBigContentView();
+ method public android.widget.RemoteViews createContentView();
+ method public android.widget.RemoteViews createHeadsUpContentView();
method public android.app.Notification.Builder extend(android.app.Notification.Extender);
method public android.os.Bundle getExtras();
method public deprecated android.app.Notification getNotification();
- method public android.widget.RemoteViews makeBigContentView();
- method public android.widget.RemoteViews makeContentView();
- method public android.widget.RemoteViews makeHeadsUpContentView();
method public static android.app.Notification.Builder recoverBuilder(android.content.Context, android.app.Notification);
method public android.app.Notification.Builder setActions(android.app.Notification.Action...);
method public android.app.Notification.Builder setAutoCancel(boolean);
method public android.app.Notification.Builder addExtras(android.os.Bundle);
method public android.app.Notification.Builder addPerson(java.lang.String);
method public android.app.Notification build();
+ method public android.widget.RemoteViews createBigContentView();
+ method public android.widget.RemoteViews createContentView();
+ method public android.widget.RemoteViews createHeadsUpContentView();
method public android.app.Notification.Builder extend(android.app.Notification.Extender);
method public android.os.Bundle getExtras();
method public deprecated android.app.Notification getNotification();
- method public android.widget.RemoteViews makeBigContentView();
- method public android.widget.RemoteViews makeContentView();
- method public android.widget.RemoteViews makeHeadsUpContentView();
method public static android.app.Notification.Builder recoverBuilder(android.content.Context, android.app.Notification);
method public android.app.Notification.Builder setActions(android.app.Notification.Action...);
method public android.app.Notification.Builder setAutoCancel(boolean);
import android.annotation.IntDef;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
-import android.annotation.SystemApi;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
-import java.util.Objects;
import java.util.Set;
/**
* 2. Style's proposed content view
* 3. Standard template view
*/
- public RemoteViews makeContentView() {
+ public RemoteViews createContentView() {
if (mN.contentView != null && (mStyle == null || !mStyle.displayCustomViewInline())) {
return mN.contentView;
} else if (mStyle != null) {
/**
* Construct a RemoteViews for the final big notification layout.
*/
- public RemoteViews makeBigContentView() {
+ public RemoteViews createBigContentView() {
RemoteViews result = null;
if (mN.bigContentView != null
&& (mStyle == null || !mStyle.displayCustomViewInline())) {
/**
* Construct a RemoteViews for the final heads-up notification layout.
*/
- public RemoteViews makeHeadsUpContentView() {
+ public RemoteViews createHeadsUpContentView() {
if (mN.headsUpContentView != null
&& (mStyle == null || !mStyle.displayCustomViewInline())) {
return mN.headsUpContentView;
return null;
}
-
return applyStandardTemplateWithActions(getBigBaseLayoutResource());
}
public RemoteViews makePublicContentView() {
if (mN.publicVersion != null) {
final Builder builder = recoverBuilder(mContext, mN.publicVersion);
- return builder.makeContentView();
+ return builder.createContentView();
}
Bundle savedBundle = mN.extras;
Style style = mStyle;
return mN;
}
+ /**
+ * Creates a Builder from an existing notification so further changes can be made.
+ * @param context The context for your application / activity.
+ * @param n The notification to create a Builder from.
+ */
public static Notification.Builder recoverBuilder(Context context, Notification n) {
// Re-create notification context so we can access app resources.
ApplicationInfo applicationInfo = n.extras.getParcelable(
if (mContext.getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.N) {
if (mN.contentView == null) {
- mN.contentView = makeContentView();
+ mN.contentView = createContentView();
mN.extras.putInt(EXTRA_REBUILD_CONTENT_VIEW_ACTION_COUNT,
mN.contentView.getSequenceNumber());
}
if (mN.bigContentView == null) {
- mN.bigContentView = makeBigContentView();
+ mN.bigContentView = createBigContentView();
if (mN.bigContentView != null) {
mN.extras.putInt(EXTRA_REBUILD_BIG_CONTENT_VIEW_ACTION_COUNT,
mN.bigContentView.getSequenceNumber());
}
}
if (mN.headsUpContentView == null) {
- mN.headsUpContentView = makeHeadsUpContentView();
+ mN.headsUpContentView = createHeadsUpContentView();
if (mN.headsUpContentView != null) {
mN.extras.putInt(EXTRA_REBUILD_HEADS_UP_CONTENT_VIEW_ACTION_COUNT,
mN.headsUpContentView.getSequenceNumber());
*/
package android.service.notification;
-import android.service.notification.IStatusBarNotificationHolder;
import android.annotation.SystemApi;
import android.annotation.SdkConstant;
private void maybePopulateRemoteViews(Notification notification) {
if (getContext().getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.N) {
Builder builder = Builder.recoverBuilder(getContext(), notification);
- notification.contentView = builder.makeContentView();
- notification.bigContentView = builder.makeBigContentView();
- notification.headsUpContentView = builder.makeHeadsUpContentView();
+ notification.contentView = builder.createContentView();
+ notification.bigContentView = builder.createBigContentView();
+ notification.headsUpContentView = builder.createHeadsUpContentView();
}
}
if (updatedNotification != null) {
final Notification.Builder updatedNotificationBuilder
= Notification.Builder.recoverBuilder(ctx, updatedNotification);
- final RemoteViews newContentView = updatedNotificationBuilder.makeContentView();
+ final RemoteViews newContentView = updatedNotificationBuilder.createContentView();
final RemoteViews newBigContentView =
- updatedNotificationBuilder.makeBigContentView();
+ updatedNotificationBuilder.createBigContentView();
final RemoteViews newHeadsUpContentView =
- updatedNotificationBuilder.makeHeadsUpContentView();
+ updatedNotificationBuilder.createHeadsUpContentView();
final RemoteViews newPublicNotification
= updatedNotificationBuilder.makePublicContentView();
final Notification.Builder builder
= Notification.Builder.recoverBuilder(ctx, notification.getNotification());
- cachedContentView = builder.makeContentView();
- cachedBigContentView = builder.makeBigContentView();
- cachedHeadsUpContentView = builder.makeHeadsUpContentView();
+ cachedContentView = builder.createContentView();
+ cachedBigContentView = builder.createBigContentView();
+ cachedHeadsUpContentView = builder.createHeadsUpContentView();
cachedPublicContentView = builder.makePublicContentView();
applyInPlace = false;