|
|
@ -15,7 +15,6 @@ import com.todoroo.astrid.gtasks.GtasksListService;
|
|
|
|
import com.todoroo.astrid.subtasks.SubtasksFilterUpdater;
|
|
|
|
import com.todoroo.astrid.subtasks.SubtasksFilterUpdater;
|
|
|
|
import com.todoroo.astrid.subtasks.SubtasksHelper;
|
|
|
|
import com.todoroo.astrid.subtasks.SubtasksHelper;
|
|
|
|
import javax.inject.Inject;
|
|
|
|
import javax.inject.Inject;
|
|
|
|
import org.tasks.R;
|
|
|
|
|
|
|
|
import org.tasks.data.CaldavCalendar;
|
|
|
|
import org.tasks.data.CaldavCalendar;
|
|
|
|
import org.tasks.data.CaldavDao;
|
|
|
|
import org.tasks.data.CaldavDao;
|
|
|
|
import org.tasks.data.GoogleTaskDao;
|
|
|
|
import org.tasks.data.GoogleTaskDao;
|
|
|
@ -66,13 +65,15 @@ public class TaskAdapterProvider {
|
|
|
|
TagFilter tagFilter = (TagFilter) filter;
|
|
|
|
TagFilter tagFilter = (TagFilter) filter;
|
|
|
|
TagData tagData = tagDataDao.getByUuid(tagFilter.getUuid());
|
|
|
|
TagData tagData = tagDataDao.getByUuid(tagFilter.getUuid());
|
|
|
|
if (tagData != null) {
|
|
|
|
if (tagData != null) {
|
|
|
|
return isManualSort() ? createManualTagTaskAdapter(tagFilter) : new TaskAdapter();
|
|
|
|
return preferences.isManualSort()
|
|
|
|
|
|
|
|
? createManualTagTaskAdapter(tagFilter)
|
|
|
|
|
|
|
|
: new TaskAdapter();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (filter instanceof GtasksFilter) {
|
|
|
|
} else if (filter instanceof GtasksFilter) {
|
|
|
|
GtasksFilter gtasksFilter = (GtasksFilter) filter;
|
|
|
|
GtasksFilter gtasksFilter = (GtasksFilter) filter;
|
|
|
|
GoogleTaskList list = gtasksListService.getList(gtasksFilter.getStoreId());
|
|
|
|
GoogleTaskList list = gtasksListService.getList(gtasksFilter.getStoreId());
|
|
|
|
if (list != null) {
|
|
|
|
if (list != null) {
|
|
|
|
return isManualSort()
|
|
|
|
return preferences.isManualSort()
|
|
|
|
? createManualGoogleTaskAdapter(gtasksFilter)
|
|
|
|
? createManualGoogleTaskAdapter(gtasksFilter)
|
|
|
|
: new TaskAdapter();
|
|
|
|
: new TaskAdapter();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -90,10 +91,6 @@ public class TaskAdapterProvider {
|
|
|
|
return new TaskAdapter();
|
|
|
|
return new TaskAdapter();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private boolean isManualSort() {
|
|
|
|
|
|
|
|
return preferences.getBoolean(R.string.p_manual_sort, false);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private TaskAdapter createManualTagTaskAdapter(TagFilter filter) {
|
|
|
|
private TaskAdapter createManualTagTaskAdapter(TagFilter filter) {
|
|
|
|
TagData tagData = filter.getTagData();
|
|
|
|
TagData tagData = filter.getTagData();
|
|
|
|
String tdId = tagData.getRemoteId();
|
|
|
|
String tdId = tagData.getRemoteId();
|
|
|
|