Simplify code; change notification actions to Yes/No/Later

This commit is contained in:
2017-11-14 22:07:52 -06:00
parent 7f1a35ebe5
commit 9d48b4bcdb
5 changed files with 15 additions and 26 deletions

View File

@@ -48,25 +48,20 @@ public class WidgetBehavior
public void onAddRepetition(@NonNull Habit habit, Timestamp timestamp)
{
notificationTray.cancel(habit);
Repetition rep = habit.getRepetitions().getByTimestamp(timestamp);
if (rep != null) return;
performToggle(habit, timestamp);
notificationTray.cancel(habit);
}
public void onRemoveRepetition(@NonNull Habit habit, Timestamp timestamp)
{
notificationTray.cancel(habit);
Repetition rep = habit.getRepetitions().getByTimestamp(timestamp);
if (rep == null) return;
performToggle(habit, timestamp);
}
public void onCancelRepetition(@NonNull Habit habit, Timestamp timestamp)
{
onRemoveRepetition(habit, timestamp);
notificationTray.cancel(habit);
}
public void onToggleRepetition(@NonNull Habit habit, Timestamp timestamp)
{
performToggle(habit, timestamp);