From f854d178647c1a5c27fdd937d4bcdb979a38dd36 Mon Sep 17 00:00:00 2001 From: NekoInverter <7741672-NekoInverter@users.noreply.gitlab.com> Date: Mon, 28 Dec 2020 14:46:20 +0800 Subject: [PATCH] Fix download notification --- .../java/com/hippo/ehviewer/download/DownloadService.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/hippo/ehviewer/download/DownloadService.java b/app/src/main/java/com/hippo/ehviewer/download/DownloadService.java index 9e602fa81..f20a429fc 100644 --- a/app/src/main/java/com/hippo/ehviewer/download/DownloadService.java +++ b/app/src/main/java/com/hippo/ehviewer/download/DownloadService.java @@ -307,7 +307,7 @@ public class DownloadService extends Service implements DownloadManager.Download mDownloadingBuilder.setContentTitle(EhUtils.getSuitableTitle(info)) .setContentText(null) - .setContentInfo(null) + .setSubText(null) .setProgress(0, 0, true) .setContentIntent(piActivity); @@ -324,7 +324,7 @@ public class DownloadService extends Service implements DownloadManager.Download if (speed < 0) { speed = 0; } - String text = FileUtils.humanReadableByteCount(speed, false) + "/S"; + String text = FileUtils.humanReadableByteCount(speed, false) + "/s"; long remaining = info.remaining; if (remaining >= 0) { text = getString(R.string.download_speed_text_2, text, ReadableTime.getShortTimeInterval(remaining)); @@ -333,7 +333,8 @@ public class DownloadService extends Service implements DownloadManager.Download } mDownloadingBuilder.setContentTitle(EhUtils.getSuitableTitle(info)) .setContentText(text) - .setContentInfo(info.total == -1 || info.finished == -1 ? null : info.finished + "/" + info.total) + .setStyle(new NotificationCompat.BigTextStyle().bigText(text)) + .setSubText(info.total == -1 || info.finished == -1 ? null : info.finished + "/" + info.total) .setProgress(info.total, info.finished, false); mDownloadingDelay.startForeground();