From b3658dc4101bcde92eb2de44adc4a4164c68cfd4 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Mon, 11 Apr 2022 16:12:23 +0200 Subject: [PATCH 1/3] Update notification text & title about quota --- .../e/drive/services/SynchronizationService.java | 10 +++++----- app/src/main/res/values/strings.xml | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/foundation/e/drive/services/SynchronizationService.java b/app/src/main/java/foundation/e/drive/services/SynchronizationService.java index afc77d70..b9d88ecc 100644 --- a/app/src/main/java/foundation/e/drive/services/SynchronizationService.java +++ b/app/src/main/java/foundation/e/drive/services/SynchronizationService.java @@ -155,11 +155,11 @@ public class SynchronizationService extends Service implements OnRemoteOperation if (callerOperation instanceof UploadFileOperation) { final Float relativeQuota = (Float) result.getData().get(1); if (relativeQuota >= 99.0) { - addNotification(getString(R.string.notif_quota_nearlyReached_title), getString(R.string.notif_quota_99Plus_text)); + addNotification(getString(R.string.notif_quota_99Plus_title), getString(R.string.notif_quota_99Plus_text)); } else if (relativeQuota >= 90.0) { - addNotification(getString(R.string.notif_quota_nearlyReached_title), getString(R.string.notif_quota_90Plus_text)); + addNotification(getString(R.string.notif_quota_80plus_title), getString(R.string.notif_quota_90Plus_text)); } else if (relativeQuota >= 80.0) { - addNotification(getString(R.string.notif_quota_nearlyReached_title), getString(R.string.notif_quota_80Plus_text)); + addNotification(getString(R.string.notif_quota_80plus_title), getString(R.string.notif_quota_80Plus_text)); } } switch (result.getCode()) { @@ -200,7 +200,7 @@ public class SynchronizationService extends Service implements OnRemoteOperation case QUOTA_EXCEEDED: //Case specific to UploadFileOperation Log.w(TAG, "Quota_EXCEEDED"); - addNotification(getString(R.string.notif_quota_execeeded_title), getString(R.string.notif_quota_execeeded_text)); + addNotification(getString(R.string.notif_quota_99Plus_title), getString(R.string.notif_quota_execeeded_text)); break; case FILE_NOT_FOUND: //Case specific to DownloadFileOperation @@ -246,7 +246,7 @@ public class SynchronizationService extends Service implements OnRemoteOperation new NotificationCompat.Builder(this, AppConstants.notificationChannelID) .setSmallIcon(android.R.drawable.stat_sys_warning) .setContentTitle(title) - .setContentText(text+ client.getBaseUri()); + .setContentText(text); // Add as notification final NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); manager.notify(0, builder.build()); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a53cf3fc..a8ce6683 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -23,10 +23,10 @@ eDrive\'s notification eDrive\'s notification channel - /e/ account\'s quota reached - /e/ account\'s quota nearly reached - eDrive can\'t upload a file that is bigger than remaining quota at: - You filled 99% of your /e/\'s account quota. check: - You filled 90% of your /e/\'s account quota. check: - You filled 80% of your /e/\'s account quota. check: + Your cloud storage is full. + Your cloud storage is nearly full. + Can\'t upload a file that is bigger than your free alloted cloud storage. + 99% of your allotted cloud storage is used. Please take action. + You've filled your allotted cloud storage up to 90%. + You've filled your allotted cloud storage up to 80%. -- GitLab From c98fb35e844c177b96811fbfef2c83ef1082cb63 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Mon, 11 Apr 2022 17:31:34 +0200 Subject: [PATCH 2/3] Update notification for Quota: use BigTextStyle() --- .../foundation/e/drive/services/SynchronizationService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/foundation/e/drive/services/SynchronizationService.java b/app/src/main/java/foundation/e/drive/services/SynchronizationService.java index b9d88ecc..76574de2 100644 --- a/app/src/main/java/foundation/e/drive/services/SynchronizationService.java +++ b/app/src/main/java/foundation/e/drive/services/SynchronizationService.java @@ -246,7 +246,8 @@ public class SynchronizationService extends Service implements OnRemoteOperation new NotificationCompat.Builder(this, AppConstants.notificationChannelID) .setSmallIcon(android.R.drawable.stat_sys_warning) .setContentTitle(title) - .setContentText(text); + .setContentText(text) + .setStyle(new NotificationCompat.BigTextStyle().bigText(text)); // Add as notification final NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); manager.notify(0, builder.build()); -- GitLab From efe584fb77f26c6f8c4c4708c6069e4699ebcf14 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Mon, 11 Apr 2022 18:13:51 +0200 Subject: [PATCH 3/3] Add missing escape character in strings to fix build issue --- app/src/main/res/values/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a8ce6683..d88a99e6 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -25,8 +25,8 @@ eDrive\'s notification channel Your cloud storage is full. Your cloud storage is nearly full. - Can\'t upload a file that is bigger than your free alloted cloud storage. + Impossible to upload a file which is bigger than your free alloted cloud storage. Please take action. 99% of your allotted cloud storage is used. Please take action. - You've filled your allotted cloud storage up to 90%. - You've filled your allotted cloud storage up to 80%. + You\'ve filled your allotted cloud storage up to 90%. + You\'ve filled your allotted cloud storage up to 80%. -- GitLab