From abf15a36354bcfd987b7a67874794af6b2021428 Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Fri, 17 May 2019 17:26:48 -0500 Subject: [PATCH] Reuse google task --- .../java/com/todoroo/astrid/adapter/GoogleTaskAdapter.java | 4 ++-- app/src/main/java/org/tasks/data/TaskContainer.java | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/todoroo/astrid/adapter/GoogleTaskAdapter.java b/app/src/main/java/com/todoroo/astrid/adapter/GoogleTaskAdapter.java index 325cf0335..acf0f5b18 100644 --- a/app/src/main/java/com/todoroo/astrid/adapter/GoogleTaskAdapter.java +++ b/app/src/main/java/com/todoroo/astrid/adapter/GoogleTaskAdapter.java @@ -68,7 +68,7 @@ public final class GoogleTaskAdapter extends TaskAdapter { @Override public void moved(int from, int to) { TaskContainer task = getTask(from); - GoogleTask googleTask = task.googletask; + GoogleTask googleTask = task.getGoogleTask(); if (to == 0) { googleTaskDao.move(googleTask, 0, 0); } else if (to == getCount()) { @@ -128,7 +128,7 @@ public final class GoogleTaskAdapter extends TaskAdapter { public void indented(int which, int delta) { TaskContainer task = getTask(which); TaskContainer previous; - GoogleTask current = googleTaskDao.getByTaskId(task.getId()); + GoogleTask current = task.getGoogleTask(); if (delta == -1) { googleTaskDao.unindent(googleTaskDao.getByTaskId(task.getParent()), current); } else { diff --git a/app/src/main/java/org/tasks/data/TaskContainer.java b/app/src/main/java/org/tasks/data/TaskContainer.java index 13eb9539d..8961ff0a2 100644 --- a/app/src/main/java/org/tasks/data/TaskContainer.java +++ b/app/src/main/java/org/tasks/data/TaskContainer.java @@ -187,4 +187,8 @@ public class TaskContainer { public boolean isLastSubtask() { return secondarySort == siblings - 1; } + + public GoogleTask getGoogleTask() { + return googletask; + } }