Remove TAGS_CHANGED flag

gtask_related_email
Alex Baker 5 years ago
parent 49535c2233
commit 8e05fab61b

@ -36,10 +36,8 @@ import com.todoroo.astrid.repeats.RepeatControlSet;
import com.todoroo.astrid.service.TaskDeleter; import com.todoroo.astrid.service.TaskDeleter;
import com.todoroo.astrid.timers.TimerPlugin; import com.todoroo.astrid.timers.TimerPlugin;
import com.todoroo.astrid.ui.EditTitleControlSet; import com.todoroo.astrid.ui.EditTitleControlSet;
import com.todoroo.astrid.utility.Flags;
import java.util.List; import java.util.List;
import javax.inject.Inject; import javax.inject.Inject;
import org.tasks.LocalBroadcastManager;
import org.tasks.R; import org.tasks.R;
import org.tasks.analytics.Tracker; import org.tasks.analytics.Tracker;
import org.tasks.data.UserActivity; import org.tasks.data.UserActivity;
@ -71,7 +69,6 @@ public final class TaskEditFragment extends InjectingFragment
@Inject Preferences preferences; @Inject Preferences preferences;
@Inject Tracker tracker; @Inject Tracker tracker;
@Inject TimerPlugin timerPlugin; @Inject TimerPlugin timerPlugin;
@Inject LocalBroadcastManager localBroadcastManager;
@BindView(R.id.toolbar) @BindView(R.id.toolbar)
Toolbar toolbar; Toolbar toolbar;
@ -216,10 +213,6 @@ public final class TaskEditFragment extends InjectingFragment
} }
taskDao.save(model, null); taskDao.save(model, null);
if (Flags.checkAndClear(Flags.TAGS_CHANGED)) {
localBroadcastManager.broadcastRefreshList();
}
if (isNewTask) { if (isNewTask) {
((MainActivity) getActivity()).getTaskListFragment().onTaskCreated(model.getUuid()); ((MainActivity) getActivity()).getTaskListFragment().onTaskCreated(model.getUuid());
} else { } else {

@ -176,7 +176,6 @@ public final class TagsControlSet extends TaskEditControlFragment {
@Override @Override
public void apply(Task task) { public void apply(Task task) {
if (synchronizeTags(task)) { if (synchronizeTags(task)) {
Flags.set(Flags.TAGS_CHANGED);
task.setModificationDate(DateUtilities.now()); task.setModificationDate(DateUtilities.now());
} }
} }

@ -8,17 +8,13 @@ package com.todoroo.astrid.utility;
public class Flags { public class Flags {
/** If set, indicates tags changed during task save */
public static final int TAGS_CHANGED = 1 << 1;
/** If set, indicates that TaskListFragmentPager should not intercept touch events */ /** If set, indicates that TaskListFragmentPager should not intercept touch events */
public static final int TLFP_NO_INTERCEPT_TOUCH = 1 << 7; public static final int TLFP_NO_INTERCEPT_TOUCH = 1 << 7;
private static int state = 0; private static int state = 0;
public static boolean checkAndClear(int flag) { public static void clear(int flag) {
boolean set = (state & flag) > 0;
state &= ~flag; state &= ~flag;
return set;
} }
public static boolean check(int flag) { public static boolean check(int flag) {

@ -251,7 +251,7 @@ public class DragAndDropRecyclerAdapter extends TaskListRecyclerAdapter {
} }
from = -1; from = -1;
to = -1; to = -1;
Flags.checkAndClear(Flags.TLFP_NO_INTERCEPT_TOUCH); Flags.clear(Flags.TLFP_NO_INTERCEPT_TOUCH);
} }
@Override @Override

Loading…
Cancel
Save