From ebfbb4f915d5dce884e31c4f7685fb9bbf25c552 Mon Sep 17 00:00:00 2001 From: olly Date: Tue, 5 Feb 2019 19:05:59 +0000 Subject: [PATCH] Hide progress bar for end state download notifications Now we're reusing the builder, it's necessary to set maxProgress back to 0 to avoid the progress bar appearing for end state notifications. PiperOrigin-RevId: 232520007 --- .../exoplayer2/ui/DownloadNotificationHelper.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/library/ui/src/main/java/com/google/android/exoplayer2/ui/DownloadNotificationHelper.java b/library/ui/src/main/java/com/google/android/exoplayer2/ui/DownloadNotificationHelper.java index b65c4fca40..94bd0b81c5 100644 --- a/library/ui/src/main/java/com/google/android/exoplayer2/ui/DownloadNotificationHelper.java +++ b/library/ui/src/main/java/com/google/android/exoplayer2/ui/DownloadNotificationHelper.java @@ -98,6 +98,7 @@ public final class DownloadNotificationHelper { contentIntent, message, titleStringId, + /* maxProgress= */ 100, progress, indeterminate, /* ongoing= */ true, @@ -142,7 +143,8 @@ public final class DownloadNotificationHelper { contentIntent, message, titleStringId, - /* progress= */ 0, + /* maxProgress= */ 0, + /* currentProgress= */ 0, /* indeterminateProgress= */ false, /* ongoing= */ false, /* showWhen= */ true); @@ -153,7 +155,8 @@ public final class DownloadNotificationHelper { @Nullable PendingIntent contentIntent, @Nullable String message, @StringRes int titleStringId, - int progress, + int maxProgress, + int currentProgress, boolean indeterminateProgress, boolean ongoing, boolean showWhen) { @@ -163,7 +166,7 @@ public final class DownloadNotificationHelper { notificationBuilder.setContentIntent(contentIntent); notificationBuilder.setStyle( message == null ? null : new NotificationCompat.BigTextStyle().bigText(message)); - notificationBuilder.setProgress(/* max= */ 100, progress, indeterminateProgress); + notificationBuilder.setProgress(maxProgress, currentProgress, indeterminateProgress); notificationBuilder.setOngoing(ongoing); notificationBuilder.setShowWhen(showWhen); return notificationBuilder.build();