|
|
|
@ -54,9 +54,7 @@ import org.tasks.R;
|
|
|
|
import org.tasks.dialogs.DialogBuilder;
|
|
|
|
import org.tasks.dialogs.DialogBuilder;
|
|
|
|
import org.tasks.preferences.ActivityPreferences;
|
|
|
|
import org.tasks.preferences.ActivityPreferences;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.Collections;
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
@ -155,8 +153,6 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
|
|
|
|
|
|
|
|
|
|
|
|
protected final int minRowHeight;
|
|
|
|
protected final int minRowHeight;
|
|
|
|
|
|
|
|
|
|
|
|
private final Map<Long, TaskAction> taskActionLoader = Collections.synchronizedMap(new HashMap<Long, TaskAction>());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public TaskAdapter(Context context, ActivityPreferences preferences, TaskAttachmentDao taskAttachmentDao, TaskService taskService, TaskListFragment fragment,
|
|
|
|
public TaskAdapter(Context context, ActivityPreferences preferences, TaskAttachmentDao taskAttachmentDao, TaskService taskService, TaskListFragment fragment,
|
|
|
|
Cursor c, AtomicReference<String> query, OnCompletedTaskListener onCompletedTaskListener,
|
|
|
|
Cursor c, AtomicReference<String> query, OnCompletedTaskListener onCompletedTaskListener,
|
|
|
|
DialogBuilder dialogBuilder) {
|
|
|
|
DialogBuilder dialogBuilder) {
|
|
|
|
@ -374,13 +370,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
|
|
|
|
if (task.isCompleted()) {
|
|
|
|
if (task.isCompleted()) {
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (taskActionLoader.containsKey(task.getId())) {
|
|
|
|
return LinkActionExposer.getActionsForTask(context, task, hasFiles, hasNotes);
|
|
|
|
return taskActionLoader.get(task.getId());
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
TaskAction action = LinkActionExposer.getActionsForTask(context, task, hasFiles, hasNotes);
|
|
|
|
|
|
|
|
taskActionLoader.put(task.getId(), action);
|
|
|
|
|
|
|
|
return action;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
public void onClick(View v) {
|
|
|
|
|