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

pull/14/head
Sam Bosley 13 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
if(task.getValue(Task.REMOTE_ID) == 0) {
if(task.getValue(Task.REMOTE_ID) == 0 && !TextUtils.isEmpty(task.getValue(Task.TITLE))) {
new Thread(new Runnable() {
@Override
public void run() {
actFmSyncService.pushTask(task.getId());
task = PluginServices.getTaskService().fetchById(task.getId(), Task.NOTES, Task.ID, Task.REMOTE_ID, Task.TITLE);
refreshData(false, callback);
}
}).start();

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

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

Loading…
Cancel
Save