public String titleForActivityType(@NonNull Context context) { if (pomodoroMaster.isOngoing()) { if (pomodoroMaster.getNextPomodoro() == null) { return null; } final String minutesLeft = Utils.convertDiffToPrettyMinutesLeft( context, pomodoroMaster.getNextPomodoro().minus(DateTime.now().getMillis())); return minutesLeft + " | " + Utils.getActivityTitle(context, pomodoroMaster, /* shorten */ true); } else { if (pomodoroMaster.getActivityType() == ActivityType.NONE) { return context.getString(R.string.title_none); } else { return context.getString(R.string.title_finished); } } }
@NonNull public Notification buildNotificationPhone(@NonNull PendingIntent contentIntent) { final DateTime nextPomodoro = pomodoroMaster.getNextPomodoro(); NotificationCompat.Builder builder = buildBaseNotification(/* isPhone */ true) .setWhen(nextPomodoro != null ? nextPomodoro.getMillis() : System.currentTimeMillis()) .setContentIntent(contentIntent); return builder.build(); }