|
|
|
@ -9,11 +9,8 @@ import java.util.List;
|
|
|
|
import java.util.TimeZone;
|
|
|
|
import java.util.TimeZone;
|
|
|
|
|
|
|
|
|
|
|
|
import android.content.BroadcastReceiver;
|
|
|
|
import android.content.BroadcastReceiver;
|
|
|
|
import android.content.ContentResolver;
|
|
|
|
|
|
|
|
import android.content.ContentValues;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import android.content.Context;
|
|
|
|
import android.content.Intent;
|
|
|
|
import android.content.Intent;
|
|
|
|
import android.net.Uri;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.google.ical.iter.RecurrenceIterator;
|
|
|
|
import com.google.ical.iter.RecurrenceIterator;
|
|
|
|
import com.google.ical.iter.RecurrenceIteratorFactory;
|
|
|
|
import com.google.ical.iter.RecurrenceIteratorFactory;
|
|
|
|
@ -23,12 +20,10 @@ import com.google.ical.values.DateValueImpl;
|
|
|
|
import com.google.ical.values.Frequency;
|
|
|
|
import com.google.ical.values.Frequency;
|
|
|
|
import com.google.ical.values.RRule;
|
|
|
|
import com.google.ical.values.RRule;
|
|
|
|
import com.google.ical.values.WeekdayNum;
|
|
|
|
import com.google.ical.values.WeekdayNum;
|
|
|
|
import com.timsu.astrid.R;
|
|
|
|
|
|
|
|
import com.todoroo.andlib.service.Autowired;
|
|
|
|
import com.todoroo.andlib.service.Autowired;
|
|
|
|
import com.todoroo.andlib.service.ContextManager;
|
|
|
|
import com.todoroo.andlib.service.ContextManager;
|
|
|
|
import com.todoroo.andlib.service.DependencyInjectionService;
|
|
|
|
import com.todoroo.andlib.service.DependencyInjectionService;
|
|
|
|
import com.todoroo.andlib.utility.DateUtilities;
|
|
|
|
import com.todoroo.andlib.utility.DateUtilities;
|
|
|
|
import com.todoroo.andlib.utility.Preferences;
|
|
|
|
|
|
|
|
import com.todoroo.astrid.actfm.sync.ActFmPreferenceService;
|
|
|
|
import com.todoroo.astrid.actfm.sync.ActFmPreferenceService;
|
|
|
|
import com.todoroo.astrid.api.AstridApiConstants;
|
|
|
|
import com.todoroo.astrid.api.AstridApiConstants;
|
|
|
|
import com.todoroo.astrid.core.PluginServices;
|
|
|
|
import com.todoroo.astrid.core.PluginServices;
|
|
|
|
@ -97,14 +92,7 @@ public class RepeatTaskCompleteListener extends BroadcastReceiver {
|
|
|
|
clone.setValue(Task.REMINDER_SNOOZE, 0L);
|
|
|
|
clone.setValue(Task.REMINDER_SNOOZE, 0L);
|
|
|
|
clone.setValue(Task.REMINDER_LAST, 0L);
|
|
|
|
clone.setValue(Task.REMINDER_LAST, 0L);
|
|
|
|
|
|
|
|
|
|
|
|
boolean gcalCreateEventEnabled = Preferences.getStringValue(R.string.gcal_p_default) != null
|
|
|
|
GCalHelper.createTaskEventIfEnabled(clone);
|
|
|
|
&& !Preferences.getStringValue(R.string.gcal_p_default).
|
|
|
|
|
|
|
|
equals("-1"); //$NON-NLS-1$
|
|
|
|
|
|
|
|
if (gcalCreateEventEnabled) {
|
|
|
|
|
|
|
|
ContentResolver cr = ContextManager.getContext().getContentResolver();
|
|
|
|
|
|
|
|
Uri calendarUri = GCalHelper.createTaskEvent(clone, cr, new ContentValues());
|
|
|
|
|
|
|
|
clone.setValue(Task.CALENDAR_URI, calendarUri.toString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
PluginServices.getTaskService().save(clone);
|
|
|
|
PluginServices.getTaskService().save(clone);
|
|
|
|
|
|
|
|
|
|
|
|
// clear recurrence from completed task so it can be re-completed
|
|
|
|
// clear recurrence from completed task so it can be re-completed
|
|
|
|
|