Make progress notifications persist

This commit is contained in:
topjohnwu 2018-12-03 01:52:36 -05:00
parent 2b502e9a0f
commit e658f9297d
2 changed files with 6 additions and 3 deletions

View File

@ -107,7 +107,8 @@ public class Notifications {
builder.setPriority(NotificationCompat.PRIORITY_LOW)
.setSmallIcon(android.R.drawable.stat_sys_download)
.setContentTitle(title)
.setProgress(0, 0, true);
.setProgress(0, 0, true)
.setOngoing(true);
return builder;
}
}

View File

@ -50,14 +50,16 @@ public class ProgressNotification implements DownloadProgressListener {
public void dlDone() {
builder.setProgress(0, 0, false)
.setContentText(Data.MM().getString(R.string.download_complete))
.setSmallIcon(R.drawable.ic_check_circle);
.setSmallIcon(R.drawable.ic_check_circle)
.setOngoing(false);
update();
}
public void dlFail() {
builder.setProgress(0, 0, false)
.setContentText(Data.MM().getString(R.string.download_file_error))
.setSmallIcon(R.drawable.ic_cancel);
.setSmallIcon(R.drawable.ic_cancel)
.setOngoing(false);
update();
}