Fix timer notifications

pull/574/head
Alex Baker 7 years ago
parent 57455c4e37
commit 400dada21f

@ -10,7 +10,7 @@ import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.support.v7.app.NotificationCompat;
import android.support.v4.app.NotificationCompat;
import com.todoroo.andlib.sql.Query;
import com.todoroo.andlib.utility.DateUtilities;
@ -106,7 +106,7 @@ public class TimerPlugin {
String appName = r.getString(R.string.app_name);
String text = r.getString(R.string.TPl_notification,
r.getQuantityString(R.plurals.Ntasks, count, count));
Notification notification = new NotificationCompat.Builder(context)
Notification notification = new NotificationCompat.Builder(context, NotificationManager.NOTIFICATION_CHANNEL_TIMERS)
.setContentIntent(pendingIntent)
.setContentTitle(appName)
.setContentText(text)

@ -43,6 +43,7 @@ public class NotificationManager {
public static final String NOTIFICATION_CHANNEL_DEFAULT = "notifications";
public static final String NOTIFICATION_CHANNEL_TASKER = "notifications_tasker";
public static final String NOTIFICATION_CHANNEL_CALLS = "notifications_calls";
public static final String NOTIFICATION_CHANNEL_TIMERS = "notifications_timers";
public static final String GROUP_KEY = "tasks";
private static final int SUMMARY_NOTIFICATION_ID = 0;
static final String EXTRA_NOTIFICATION_ID = "extra_notification_id";
@ -66,6 +67,7 @@ public class NotificationManager {
notificationManager.createNotificationChannel(createNotificationChannel(NOTIFICATION_CHANNEL_DEFAULT, R.string.notifications));
notificationManager.createNotificationChannel(createNotificationChannel(NOTIFICATION_CHANNEL_CALLS, R.string.missed_calls));
notificationManager.createNotificationChannel(createNotificationChannel(NOTIFICATION_CHANNEL_TASKER, R.string.tasker_locale));
notificationManager.createNotificationChannel(createNotificationChannel(NOTIFICATION_CHANNEL_TIMERS, R.string.TEA_timer_controls));
}
}

Loading…
Cancel
Save