Added the task description to the notifications

save_or_discard
Kevin D Jones 8 years ago committed by Alex Baker
parent aa81284887
commit 4d48c6abbe

@ -197,7 +197,7 @@ public class Notifier {
Task task; Task task;
try { try {
task = taskDao.fetch(id, Task.ID, Task.TITLE, Task.HIDE_UNTIL, Task.COMPLETION_DATE, task = taskDao.fetch(id, Task.ID, Task.TITLE, Task.HIDE_UNTIL, Task.COMPLETION_DATE,
Task.DUE_DATE, Task.DELETION_DATE, Task.REMINDER_FLAGS); Task.DUE_DATE, Task.DELETION_DATE, Task.REMINDER_FLAGS, Task.NOTES);
if (task == null) { if (task == null) {
throw new IllegalArgumentException("cound not find item with id"); //$NON-NLS-1$ throw new IllegalArgumentException("cound not find item with id"); //$NON-NLS-1$
} }
@ -232,6 +232,7 @@ public class Notifier {
// read properties // read properties
final String taskTitle = task.getTitle(); final String taskTitle = task.getTitle();
final String taskDescription = task.getNotes();
boolean nonstopMode = task.isNotifyModeNonstop(); boolean nonstopMode = task.isNotifyModeNonstop();
boolean ringFiveMode = task.isNotifyModeFive(); boolean ringFiveMode = task.isNotifyModeFive();
int ringTimes = nonstopMode ? -1 : (ringFiveMode ? 5 : 1); int ringTimes = nonstopMode ? -1 : (ringFiveMode ? 5 : 1);
@ -260,6 +261,8 @@ public class Notifier {
.setWhen(currentTimeMillis()) .setWhen(currentTimeMillis())
.setContentTitle(taskTitle) .setContentTitle(taskTitle)
.setContentText(text) .setContentText(text)
.setStyle(new NotificationCompat.BigTextStyle()
.bigText(taskDescription.equals("") ? text : taskDescription))
.setContentIntent(PendingIntent.getActivity(context, (int) id, intent, PendingIntent.FLAG_UPDATE_CURRENT)); .setContentIntent(PendingIntent.getActivity(context, (int) id, intent, PendingIntent.FLAG_UPDATE_CURRENT));
if (preferences.useNotificationActions()) { if (preferences.useNotificationActions()) {
PendingIntent completeIntent = PendingIntent.getBroadcast(context, (int) id, new Intent(context, CompleteTaskReceiver.class) {{ PendingIntent completeIntent = PendingIntent.getBroadcast(context, (int) id, new Intent(context, CompleteTaskReceiver.class) {{

Loading…
Cancel
Save