public final class DownloadNotificationUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static android.app.Notification |
buildDownloadCompletedNotification(android.content.Context context,
int smallIcon,
java.lang.String channelId,
android.app.PendingIntent contentIntent,
java.lang.String message)
Returns a notification for a completed download.
|
static android.app.Notification |
buildDownloadFailedNotification(android.content.Context context,
int smallIcon,
java.lang.String channelId,
android.app.PendingIntent contentIntent,
java.lang.String message)
Returns a notification for a failed download.
|
static android.app.Notification |
buildProgressNotification(android.content.Context context,
int smallIcon,
java.lang.String channelId,
android.app.PendingIntent contentIntent,
java.lang.String message,
com.google.android.exoplayer2.offline.DownloadManager.TaskState[] taskStates)
Returns a progress notification for the given task states.
|
public static android.app.Notification buildProgressNotification(android.content.Context context,
@DrawableRes
int smallIcon,
java.lang.String channelId,
@Nullable
android.app.PendingIntent contentIntent,
@Nullable
java.lang.String message,
com.google.android.exoplayer2.offline.DownloadManager.TaskState[] taskStates)
context - A context for accessing resources.smallIcon - A small icon for the notification.channelId - The id of the notification channel to use. Only required for API level 26 and
above.contentIntent - An optional content intent to send when the notification is clicked.message - An optional message to display on the notification.taskStates - The task states.public static android.app.Notification buildDownloadCompletedNotification(android.content.Context context,
@DrawableRes
int smallIcon,
java.lang.String channelId,
@Nullable
android.app.PendingIntent contentIntent,
@Nullable
java.lang.String message)
context - A context for accessing resources.smallIcon - A small icon for the notifications.channelId - The id of the notification channel to use. Only required for API level 26 and
above.contentIntent - An optional content intent to send when the notification is clicked.message - An optional message to display on the notification.public static android.app.Notification buildDownloadFailedNotification(android.content.Context context,
@DrawableRes
int smallIcon,
java.lang.String channelId,
@Nullable
android.app.PendingIntent contentIntent,
@Nullable
java.lang.String message)
context - A context for accessing resources.smallIcon - A small icon for the notifications.channelId - The id of the notification channel to use. Only required for API level 26 and
above.contentIntent - An optional content intent to send when the notification is clicked.message - An optional message to display on the notification.