From 878770e92802d51cbfd289dac1acbebebdac0991 Mon Sep 17 00:00:00 2001 From: Moez Bhatti Date: Tue, 28 Aug 2018 13:10:39 -0400 Subject: [PATCH] Update styling for progress notification --- .../main/java/com/moez/QKSMS/service/RestoreBackupService.kt | 4 +++- .../com/moez/QKSMS/common/util/NotificationManagerImpl.kt | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/data/src/main/java/com/moez/QKSMS/service/RestoreBackupService.kt b/data/src/main/java/com/moez/QKSMS/service/RestoreBackupService.kt index c46efa94..cffeb588 100644 --- a/data/src/main/java/com/moez/QKSMS/service/RestoreBackupService.kt +++ b/data/src/main/java/com/moez/QKSMS/service/RestoreBackupService.kt @@ -83,7 +83,9 @@ class RestoreBackupService : Service() { .subscribe { progress -> when (progress) { is BackupRepository.Progress.Running -> { - notification.setProgress(100, progress.progress, false) + notification + .setProgress(100, progress.progress, false) + .setContentText("${progress.progress}%") notificationManager.notify(NOTIFICATION_ID, notification.build()) } diff --git a/presentation/src/main/java/com/moez/QKSMS/common/util/NotificationManagerImpl.kt b/presentation/src/main/java/com/moez/QKSMS/common/util/NotificationManagerImpl.kt index 0be7e2c3..e146a58b 100644 --- a/presentation/src/main/java/com/moez/QKSMS/common/util/NotificationManagerImpl.kt +++ b/presentation/src/main/java/com/moez/QKSMS/common/util/NotificationManagerImpl.kt @@ -386,7 +386,11 @@ class NotificationManagerImpl @Inject constructor( return NotificationCompat.Builder(context, BACKUP_RESTORE_CHANNEL_ID) .setContentTitle(context.getString(R.string.backup_restoring)) + .setShowWhen(false) + .setWhen(System.currentTimeMillis()) // Set this anyway in case it's shown .setSmallIcon(R.drawable.ic_file_download_black_24dp) + .setColor(colors.theme().theme) + .setCategory(NotificationCompat.CATEGORY_PROGRESS) .setPriority(NotificationCompat.PRIORITY_MIN) .setProgress(0, 0, true) .setOngoing(true)