Fixed a bug where push task could be called in infinite recursion by activity tab, other small things

pull/14/head
Sam Bosley 14 years ago
parent 60eee30bdd
commit a804c51c88

@ -406,11 +406,12 @@ public class EditNoteActivity extends LinearLayout implements TimerActionListene
} }
// push task if it hasn't been pushed // push task if it hasn't been pushed
if(task.getValue(Task.REMOTE_ID) == 0) { if(task.getValue(Task.REMOTE_ID) == 0 && !TextUtils.isEmpty(task.getValue(Task.TITLE))) {
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
actFmSyncService.pushTask(task.getId()); actFmSyncService.pushTask(task.getId());
task = PluginServices.getTaskService().fetchById(task.getId(), Task.NOTES, Task.ID, Task.REMOTE_ID, Task.TITLE);
refreshData(false, callback); refreshData(false, callback);
} }
}).start(); }).start();

@ -15,6 +15,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="2dip" android:layout_marginTop="2dip"
android:layout_weight="1" android:layout_weight="1"
android:textColor="@android:color/black"
android:hint="@string/actfm_person_hint" /> android:hint="@string/actfm_person_hint" />
<ImageButton <ImageButton
android:id="@+id/assigned_clear" android:id="@+id/assigned_clear"

@ -430,7 +430,7 @@ public class TaskListActivity extends AstridActivity implements MainMenuListener
tlf.refresh(); tlf.refresh();
} }
protected void switchToAssignedFilter(final String assignedEmail) { public void switchToAssignedFilter(final String assignedEmail) {
TaskListFragment tlf = getTaskListFragment(); TaskListFragment tlf = getTaskListFragment();
if (tlf != null && !tlf.isFilter()) { if (tlf != null && !tlf.isFilter()) {
DialogInterface.OnClickListener okListener = new DialogInterface.OnClickListener() { DialogInterface.OnClickListener okListener = new DialogInterface.OnClickListener() {

@ -32,6 +32,7 @@ import com.todoroo.astrid.actfm.EditPeopleControlSet;
import com.todoroo.astrid.actfm.sync.ActFmPreferenceService; import com.todoroo.astrid.actfm.sync.ActFmPreferenceService;
import com.todoroo.astrid.activity.AstridActivity; import com.todoroo.astrid.activity.AstridActivity;
import com.todoroo.astrid.activity.TaskEditFragment; import com.todoroo.astrid.activity.TaskEditFragment;
import com.todoroo.astrid.activity.TaskListActivity;
import com.todoroo.astrid.activity.TaskListFragment; import com.todoroo.astrid.activity.TaskListFragment;
import com.todoroo.astrid.activity.TaskListFragment.OnTaskListItemClickedListener; import com.todoroo.astrid.activity.TaskListFragment.OnTaskListItemClickedListener;
import com.todoroo.astrid.data.TagData; import com.todoroo.astrid.data.TagData;
@ -242,7 +243,8 @@ public class QuickAddBar extends LinearLayout {
try { try {
if (title != null) if (title != null)
title = title.trim(); title = title.trim();
if (!peopleControl.willBeAssignedToMe() && !actFmPreferenceService.isLoggedIn()) { boolean assignedToMe = peopleControl.willBeAssignedToMe();
if (!assignedToMe && !actFmPreferenceService.isLoggedIn()) {
DialogInterface.OnClickListener okListener = new DialogInterface.OnClickListener() { DialogInterface.OnClickListener okListener = new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface d, int which) { public void onClick(DialogInterface d, int which) {
@ -278,6 +280,8 @@ public class QuickAddBar extends LinearLayout {
peopleControl.saveSharingSettings(null); peopleControl.saveSharingSettings(null);
taskService.save(task); taskService.save(task);
String assignedTo = peopleControl.getAssignedToString();
resetControlSets(); resetControlSets();
boolean gcalCreateEventEnabled = Preferences.getStringValue(R.string.gcal_p_default) != null boolean gcalCreateEventEnabled = Preferences.getStringValue(R.string.gcal_p_default) != null
@ -295,6 +299,9 @@ public class QuickAddBar extends LinearLayout {
if(title.length() > 0) if(title.length() > 0)
fragment.showTaskEditHelpPopover(); fragment.showTaskEditHelpPopover();
if (activity instanceof TaskListActivity && !assignedToMe)
((TaskListActivity) activity).switchToAssignedFilter(assignedTo);
TextView quickAdd = (TextView) findViewById(R.id.quickAddText); TextView quickAdd = (TextView) findViewById(R.id.quickAddText);
quickAdd.setText(""); //$NON-NLS-1$ quickAdd.setText(""); //$NON-NLS-1$

Loading…
Cancel
Save