Refactoring

pull/156/head
M66B 6 years ago
parent ce39566d60
commit 6fb436155a

@ -1885,8 +1885,8 @@ class Core {
R.plurals.title_notification_unseen, messages.size(), messages.size());
// Build notification
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, "notification");
builder
NotificationCompat.Builder builder =
new NotificationCompat.Builder(context, "notification")
.setSmallIcon(R.drawable.baseline_email_white_24)
.setContentTitle(title)
.setContentIntent(piSummary)
@ -1972,10 +1972,8 @@ class Core {
? Helper.localizeFolderName(context, message.folderName)
: message.folderDisplay;
NotificationCompat.Builder mbuilder;
mbuilder = new NotificationCompat.Builder(context, channelName);
mbuilder
NotificationCompat.Builder mbuilder =
new NotificationCompat.Builder(context, channelName)
.addExtras(args)
.setSmallIcon(R.drawable.baseline_email_white_24)
.setContentTitle(info.getDisplayName(true))
@ -2179,9 +2177,8 @@ class Core {
context, ActivityView.REQUEST_ERROR, intent, PendingIntent.FLAG_UPDATE_CURRENT);
// Build notification
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, channel);
builder
NotificationCompat.Builder builder =
new NotificationCompat.Builder(context, channel)
.setSmallIcon(R.drawable.baseline_warning_white_24)
.setContentTitle(context.getString(R.string.title_notification_failed, title))
.setContentText(Helper.formatThrowable(ex))

@ -80,9 +80,8 @@ public class ServiceExternal extends Service {
}
private NotificationCompat.Builder getNotification() {
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, "service");
builder
NotificationCompat.Builder builder =
new NotificationCompat.Builder(this, "service")
.setSmallIcon(R.drawable.baseline_compare_arrows_white_24)
.setContentTitle(getString(R.string.tile_synchronize))
.setAutoCancel(false)

@ -123,9 +123,8 @@ public class ServiceSend extends LifecycleService {
PendingIntent pi = PendingIntent.getActivity(
this, ActivityView.REQUEST_OUTBOX, intent, PendingIntent.FLAG_UPDATE_CURRENT);
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, "send");
builder
NotificationCompat.Builder builder =
new NotificationCompat.Builder(this, "send")
.setSmallIcon(R.drawable.baseline_send_24)
.setContentTitle(getString(R.string.title_notification_sending))
.setContentIntent(pi)

@ -266,9 +266,8 @@ public class ServiceSynchronize extends LifecycleService {
PendingIntent piWhy = PendingIntent.getActivity(this, ActivityView.REQUEST_WHY, why, PendingIntent.FLAG_UPDATE_CURRENT);
// Build notification
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, "service");
builder
NotificationCompat.Builder builder =
new NotificationCompat.Builder(this, "service")
.setSmallIcon(R.drawable.baseline_compare_arrows_white_24)
.setContentTitle(getResources().getQuantityString(
R.plurals.title_notification_synchronizing, lastStats.accounts, lastStats.accounts))

Loading…
Cancel
Save