Pass task and metadata service to helper

pull/189/head
Alex Baker 11 years ago
parent 7c90ac7aeb
commit 0fc86a66fb

@ -22,6 +22,7 @@ import com.todoroo.astrid.dao.StoreObjectDao;
import com.todoroo.astrid.data.StoreObject; import com.todoroo.astrid.data.StoreObject;
import com.todoroo.astrid.data.Task; import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.helper.ProgressBarSyncResultCallback; import com.todoroo.astrid.helper.ProgressBarSyncResultCallback;
import com.todoroo.astrid.service.MetadataService;
import com.todoroo.astrid.service.SyncV2Service; import com.todoroo.astrid.service.SyncV2Service;
import com.todoroo.astrid.service.TaskService; import com.todoroo.astrid.service.TaskService;
import com.todoroo.astrid.subtasks.OrderedListFragmentHelperInterface; import com.todoroo.astrid.subtasks.OrderedListFragmentHelperInterface;
@ -37,6 +38,7 @@ public class GtasksListFragment extends SubtasksListFragment {
public static final String TOKEN_STORE_ID = "storeId"; //$NON-NLS-1$ public static final String TOKEN_STORE_ID = "storeId"; //$NON-NLS-1$
@Inject TaskService taskService; @Inject TaskService taskService;
@Inject MetadataService metadataService;
@Inject StoreObjectDao storeObjectDao; @Inject StoreObjectDao storeObjectDao;
@Inject GtasksTaskListUpdater gtasksTaskListUpdater; @Inject GtasksTaskListUpdater gtasksTaskListUpdater;
@Inject GtasksMetadataService gtasksMetadataService; @Inject GtasksMetadataService gtasksMetadataService;
@ -55,7 +57,7 @@ public class GtasksListFragment extends SubtasksListFragment {
@Override @Override
protected OrderedListFragmentHelperInterface<?> createFragmentHelper() { protected OrderedListFragmentHelperInterface<?> createFragmentHelper() {
return new OrderedMetadataListFragmentHelper<>(this, gtasksTaskListUpdater); return new OrderedMetadataListFragmentHelper<>(taskService, metadataService, this, gtasksTaskListUpdater);
} }
@Override @Override

@ -19,8 +19,6 @@ import com.commonsware.cwac.tlv.TouchListView.GrabberClickListener;
import com.commonsware.cwac.tlv.TouchListView.SwipeListener; import com.commonsware.cwac.tlv.TouchListView.SwipeListener;
import com.todoroo.andlib.data.Property; import com.todoroo.andlib.data.Property;
import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.data.TodorooCursor;
import com.todoroo.andlib.service.Autowired;
import com.todoroo.andlib.service.DependencyInjectionService;
import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.andlib.utility.DateUtilities;
import com.todoroo.andlib.utility.DialogUtilities; import com.todoroo.andlib.utility.DialogUtilities;
import com.todoroo.andlib.utility.Preferences; import com.todoroo.andlib.utility.Preferences;
@ -53,15 +51,16 @@ public class OrderedMetadataListFragmentHelper<LIST> implements OrderedListFragm
private final OrderedMetadataListUpdater<LIST> updater; private final OrderedMetadataListUpdater<LIST> updater;
private final TaskListFragment fragment; private final TaskListFragment fragment;
@Autowired TaskService taskService; private final TaskService taskService;
@Autowired MetadataService metadataService; private final MetadataService metadataService;
private DraggableTaskAdapter taskAdapter; private DraggableTaskAdapter taskAdapter;
private LIST list; private LIST list;
public OrderedMetadataListFragmentHelper(TaskListFragment fragment, OrderedMetadataListUpdater<LIST> updater) { public OrderedMetadataListFragmentHelper(TaskService taskService, MetadataService metadataService, TaskListFragment fragment, OrderedMetadataListUpdater<LIST> updater) {
DependencyInjectionService.getInstance().inject(this); this.taskService = taskService;
this.metadataService = metadataService;
this.fragment = fragment; this.fragment = fragment;
this.updater = updater; this.updater = updater;
} }

Loading…
Cancel
Save