Show 0, 1 or more accounts, operations, messages

Refs #26
This commit is contained in:
M66B
2018-08-08 11:41:49 +00:00
parent 93f75af745
commit ac1e20857d
38 changed files with 721 additions and 259 deletions

View File

@@ -214,8 +214,7 @@ public class ServiceSynchronize extends LifecycleService {
builder
.setSmallIcon(R.drawable.baseline_mail_outline_24)
.setContentTitle(getString(R.string.title_notification_synchronizing, accounts))
.setContentText(getString(R.string.title_notification_operations, operations))
.setContentTitle(getResources().getQuantityString(R.plurals.title_notification_synchronizing, accounts, accounts))
.setContentIntent(pi)
.setAutoCancel(false)
.setShowWhen(false)
@@ -223,6 +222,9 @@ public class ServiceSynchronize extends LifecycleService {
.setCategory(Notification.CATEGORY_STATUS)
.setVisibility(Notification.VISIBILITY_SECRET);
if (operations > 0)
builder.setContentText(getResources().getQuantityString(R.plurals.title_notification_operations, operations, operations));
return builder;
}
@@ -249,7 +251,7 @@ public class ServiceSynchronize extends LifecycleService {
builder
.setSmallIcon(R.drawable.baseline_mail_24)
.setContentTitle(getString(R.string.title_notification_unseen, unseen))
.setContentTitle(getResources().getQuantityString(R.plurals.title_notification_unseen, unseen, unseen))
.setContentIntent(pi)
.setSound(uri)
.setShowWhen(false)