From 07f8583c3d076eb4446e02a86ce2efe2a29f63ac Mon Sep 17 00:00:00 2001 From: Kristian Tashkov Date: Sat, 12 Sep 2020 21:15:23 +0300 Subject: [PATCH] Don't show reminders from archived habits (#639) --- .../uhabits/core/ui/NotificationTray.java | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/android/uhabits-core/src/main/java/org/isoron/uhabits/core/ui/NotificationTray.java b/android/uhabits-core/src/main/java/org/isoron/uhabits/core/ui/NotificationTray.java index 2c348470..4ada1375 100644 --- a/android/uhabits-core/src/main/java/org/isoron/uhabits/core/ui/NotificationTray.java +++ b/android/uhabits-core/src/main/java/org/isoron/uhabits/core/ui/NotificationTray.java @@ -194,14 +194,6 @@ public class NotificationTray return; } - if (!shouldShowReminderToday()) { - systemTray.log(String.format( - Locale.US, - "Habit %d not supposed to run today. Skipping.", - habit.id)); - return; - } - if (!habit.hasReminder()) { systemTray.log(String.format( Locale.US, @@ -210,6 +202,23 @@ public class NotificationTray return; } + if (habit.isArchived()) + { + systemTray.log(String.format( + Locale.US, + "Habit %d is archived. Skipping.", + habit.id)); + return; + } + + if (!shouldShowReminderToday()) { + systemTray.log(String.format( + Locale.US, + "Habit %d not supposed to run today. Skipping.", + habit.id)); + return; + } + systemTray.showNotification(habit, getNotificationId(habit), timestamp, reminderTime); }