public final class DownloadNotificationHelper extends Object
| Constructor | Description |
|---|---|
DownloadNotificationHelper(Context context,
String channelId) |
| Modifier and Type | Method | Description |
|---|---|---|
Notification |
buildDownloadCompletedNotification(Context context,
int smallIcon,
PendingIntent contentIntent,
String message) |
Returns a notification for a completed download.
|
Notification |
buildDownloadFailedNotification(Context context,
int smallIcon,
PendingIntent contentIntent,
String message) |
Returns a notification for a failed download.
|
Notification |
buildProgressNotification(Context context,
int smallIcon,
PendingIntent contentIntent,
String message,
List<Download> downloads) |
Returns a progress notification for the given downloads.
|
public Notification buildProgressNotification(Context context, @DrawableRes int smallIcon, @Nullable PendingIntent contentIntent, @Nullable String message, List<Download> downloads)
context - A context.smallIcon - A small icon for the notification.contentIntent - An optional content intent to send when the notification is clicked.message - An optional message to display on the notification.downloads - The downloads.public Notification buildDownloadCompletedNotification(Context context, @DrawableRes int smallIcon, @Nullable PendingIntent contentIntent, @Nullable String message)
context - A context.smallIcon - A small icon for the notifications.contentIntent - An optional content intent to send when the notification is clicked.message - An optional message to display on the notification.public Notification buildDownloadFailedNotification(Context context, @DrawableRes int smallIcon, @Nullable PendingIntent contentIntent, @Nullable String message)
context - A context.smallIcon - A small icon for the notifications.contentIntent - An optional content intent to send when the notification is clicked.message - An optional message to display on the notification.