Skip showing zero accounts

pull/192/head
M66B 4 years ago
parent 3478fe0624
commit 172e9df5e3

@ -929,8 +929,6 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
NotificationCompat.Builder builder = NotificationCompat.Builder builder =
new NotificationCompat.Builder(this, "service") new NotificationCompat.Builder(this, "service")
.setSmallIcon(R.drawable.baseline_compare_arrows_white_24) .setSmallIcon(R.drawable.baseline_compare_arrows_white_24)
.setContentTitle(getResources().getQuantityString(
R.plurals.title_notification_synchronizing, lastAccounts, lastAccounts))
.setContentIntent(piWhy) .setContentIntent(piWhy)
.setAutoCancel(false) .setAutoCancel(false)
.setShowWhen(false) .setShowWhen(false)
@ -940,6 +938,10 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
.setVisibility(NotificationCompat.VISIBILITY_SECRET) .setVisibility(NotificationCompat.VISIBILITY_SECRET)
.setLocalOnly(true); .setLocalOnly(true);
if (lastAccounts > 0)
builder.setContentTitle(getResources().getQuantityString(
R.plurals.title_notification_synchronizing, lastAccounts, lastAccounts));
if (lastOperations > 0) if (lastOperations > 0)
builder.setContentText(getResources().getQuantityString( builder.setContentText(getResources().getQuantityString(
R.plurals.title_notification_operations, lastOperations, lastOperations)); R.plurals.title_notification_operations, lastOperations, lastOperations));

Loading…
Cancel
Save