private NotificationCompat.Action getNotificationAction() { final NotificationCompat.Action action; if (pomodoroMaster.isOngoing()) { action = buildStopAction(context); } else { ActivityType activityType = pomodoroMaster.getActivityType(); if (activityType == ActivityType.NONE) { activityType = ActivityType.POMODORO; } action = buildStartAction(context, activityType); } return action; }
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); } } }