mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
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
This commit is contained in:
parent
0bf9ebf91e
commit
ebfbb4f915
1 changed files with 6 additions and 3 deletions
|
|
@ -98,6 +98,7 @@ public final class DownloadNotificationHelper {
|
||||||
contentIntent,
|
contentIntent,
|
||||||
message,
|
message,
|
||||||
titleStringId,
|
titleStringId,
|
||||||
|
/* maxProgress= */ 100,
|
||||||
progress,
|
progress,
|
||||||
indeterminate,
|
indeterminate,
|
||||||
/* ongoing= */ true,
|
/* ongoing= */ true,
|
||||||
|
|
@ -142,7 +143,8 @@ public final class DownloadNotificationHelper {
|
||||||
contentIntent,
|
contentIntent,
|
||||||
message,
|
message,
|
||||||
titleStringId,
|
titleStringId,
|
||||||
/* progress= */ 0,
|
/* maxProgress= */ 0,
|
||||||
|
/* currentProgress= */ 0,
|
||||||
/* indeterminateProgress= */ false,
|
/* indeterminateProgress= */ false,
|
||||||
/* ongoing= */ false,
|
/* ongoing= */ false,
|
||||||
/* showWhen= */ true);
|
/* showWhen= */ true);
|
||||||
|
|
@ -153,7 +155,8 @@ public final class DownloadNotificationHelper {
|
||||||
@Nullable PendingIntent contentIntent,
|
@Nullable PendingIntent contentIntent,
|
||||||
@Nullable String message,
|
@Nullable String message,
|
||||||
@StringRes int titleStringId,
|
@StringRes int titleStringId,
|
||||||
int progress,
|
int maxProgress,
|
||||||
|
int currentProgress,
|
||||||
boolean indeterminateProgress,
|
boolean indeterminateProgress,
|
||||||
boolean ongoing,
|
boolean ongoing,
|
||||||
boolean showWhen) {
|
boolean showWhen) {
|
||||||
|
|
@ -163,7 +166,7 @@ public final class DownloadNotificationHelper {
|
||||||
notificationBuilder.setContentIntent(contentIntent);
|
notificationBuilder.setContentIntent(contentIntent);
|
||||||
notificationBuilder.setStyle(
|
notificationBuilder.setStyle(
|
||||||
message == null ? null : new NotificationCompat.BigTextStyle().bigText(message));
|
message == null ? null : new NotificationCompat.BigTextStyle().bigText(message));
|
||||||
notificationBuilder.setProgress(/* max= */ 100, progress, indeterminateProgress);
|
notificationBuilder.setProgress(maxProgress, currentProgress, indeterminateProgress);
|
||||||
notificationBuilder.setOngoing(ongoing);
|
notificationBuilder.setOngoing(ongoing);
|
||||||
notificationBuilder.setShowWhen(showWhen);
|
notificationBuilder.setShowWhen(showWhen);
|
||||||
return notificationBuilder.build();
|
return notificationBuilder.build();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue