From 151327e9ba7724832fea856f8fed45485d6536a5 Mon Sep 17 00:00:00 2001 From: Kr328 <39107975+Kr328@users.noreply.github.com> Date: Tue, 14 Apr 2020 00:58:07 +0800 Subject: [PATCH] add waiting status for profile service --- app/src/main/AndroidManifest.xml | 7 ------- .../github/kr328/clash/service/ProfileBackgroundService.kt | 7 ++++++- service/src/main/res/values-zh/strings.xml | 1 + service/src/main/res/values/strings.xml | 3 ++- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 05bf275..d0f109e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -109,12 +109,5 @@ - - - - - diff --git a/service/src/main/java/com/github/kr328/clash/service/ProfileBackgroundService.kt b/service/src/main/java/com/github/kr328/clash/service/ProfileBackgroundService.kt index 4e1fd33..648b064 100644 --- a/service/src/main/java/com/github/kr328/clash/service/ProfileBackgroundService.kt +++ b/service/src/main/java/com/github/kr328/clash/service/ProfileBackgroundService.kt @@ -159,9 +159,14 @@ class ProfileBackgroundService : BaseService() { } private fun refreshStatusNotification(queueSize: Int) { + val content = if ( queueSize != 0 ) + getString(R.string.format_in_queue, queueSize) + else + getString(R.string.waiting) + val notification = NotificationCompat.Builder(this, NotificationChannels.PROFILE_STATUS) .setContentTitle(getText(R.string.processing_profiles)) - .setContentText(getString(R.string.format_in_queue, queueSize)) + .setContentText(content) .setColor(getColor(R.color.colorAccentService)) .setSmallIcon(R.drawable.ic_notification) .setOnlyAlertOnce(true) diff --git a/service/src/main/res/values-zh/strings.xml b/service/src/main/res/values-zh/strings.xml index c78525a..e2a3f32 100644 --- a/service/src/main/res/values-zh/strings.xml +++ b/service/src/main/res/values-zh/strings.xml @@ -15,4 +15,5 @@ 配置文件和外部引用 配置文件.yaml 外部引用文件 + 等待中 \ No newline at end of file diff --git a/service/src/main/res/values/strings.xml b/service/src/main/res/values/strings.xml index 505c7d0..113b29f 100644 --- a/service/src/main/res/values/strings.xml +++ b/service/src/main/res/values/strings.xml @@ -5,7 +5,8 @@ Clash Status Profile Service Status Processing Profiles - %d items in Queue + %d items in queue + Waiting Process Result Update %s Completed Update %s Failure