|
|
@ -124,16 +124,15 @@ class AstridOrderedListFragmentHelper {
|
|
|
|
private void setCompletedForItemAndSubtasks(final Task item, final boolean completedState) {
|
|
|
|
private void setCompletedForItemAndSubtasks(final Task item, final boolean completedState) {
|
|
|
|
final String itemId = item.getUuid();
|
|
|
|
final String itemId = item.getUuid();
|
|
|
|
|
|
|
|
|
|
|
|
final Task model = new Task();
|
|
|
|
|
|
|
|
final long completionDate = completedState ? DateUtilities.now() : 0;
|
|
|
|
final long completionDate = completedState ? DateUtilities.now() : 0;
|
|
|
|
|
|
|
|
|
|
|
|
if(!completedState) {
|
|
|
|
if(!completedState) {
|
|
|
|
ArrayList<String> chained = chainedCompletions.get(itemId);
|
|
|
|
ArrayList<String> chained = chainedCompletions.get(itemId);
|
|
|
|
if(chained != null) {
|
|
|
|
if(chained != null) {
|
|
|
|
for(String taskId : chained) {
|
|
|
|
for(String taskId : chained) {
|
|
|
|
|
|
|
|
Task model = new Task();
|
|
|
|
model.setCompletionDate(completionDate);
|
|
|
|
model.setCompletionDate(completionDate);
|
|
|
|
taskDao.update(Task.UUID.eq(taskId), model);
|
|
|
|
taskDao.update(Task.UUID.eq(taskId), model);
|
|
|
|
model.clear();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
taskAdapter.notifyDataSetInvalidated();
|
|
|
|
taskAdapter.notifyDataSetInvalidated();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -143,9 +142,9 @@ class AstridOrderedListFragmentHelper {
|
|
|
|
final ArrayList<String> chained = new ArrayList<>();
|
|
|
|
final ArrayList<String> chained = new ArrayList<>();
|
|
|
|
updater.applyToDescendants(itemId, node -> {
|
|
|
|
updater.applyToDescendants(itemId, node -> {
|
|
|
|
String uuid = node.uuid;
|
|
|
|
String uuid = node.uuid;
|
|
|
|
|
|
|
|
Task model = new Task();
|
|
|
|
model.setCompletionDate(completionDate);
|
|
|
|
model.setCompletionDate(completionDate);
|
|
|
|
taskDao.update(Task.UUID.eq(uuid), model);
|
|
|
|
taskDao.update(Task.UUID.eq(uuid), model);
|
|
|
|
model.clear();
|
|
|
|
|
|
|
|
chained.add(node.uuid);
|
|
|
|
chained.add(node.uuid);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|