|
|
|
|
@ -88,8 +88,8 @@ import com.timsu.astrid.widget.TimeDurationControlSet.TimeDurationType;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This activity is responsible for creating new tasks and editing existing
|
|
|
|
|
* ones. It saves a task when it is paused (screen rotated, back button pressed)
|
|
|
|
|
* as long as the task has a title.
|
|
|
|
|
* ones. It saves a task when it is paused (screen rotated, back button
|
|
|
|
|
* pressed) as long as the task has a title.
|
|
|
|
|
*
|
|
|
|
|
* @author timsu
|
|
|
|
|
*
|
|
|
|
|
@ -192,32 +192,32 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
return controller.createNewTaskForEdit();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* ======================================================================
|
|
|
|
|
/* ======================================================================
|
|
|
|
|
* =============================================== model reading / saving
|
|
|
|
|
* ======================================================================
|
|
|
|
|
*/
|
|
|
|
|
* ====================================================================== */
|
|
|
|
|
|
|
|
|
|
/** Populate UI component values from the model */
|
|
|
|
|
private void populateFields() {
|
|
|
|
|
Resources r = getResources();
|
|
|
|
|
|
|
|
|
|
// set UI components based on model variables
|
|
|
|
|
if (model.getCursor() != null)
|
|
|
|
|
if(model.getCursor() != null)
|
|
|
|
|
startManagingCursor(model.getCursor());
|
|
|
|
|
if (model.getTaskIdentifier() == null) {
|
|
|
|
|
if(model.getTaskIdentifier() == null) {
|
|
|
|
|
FlurryAgent.onEvent("create-task");
|
|
|
|
|
Bundle extras = getIntent().getExtras();
|
|
|
|
|
if (extras != null && extras.containsKey(START_CHAR_TOKEN))
|
|
|
|
|
if(extras != null && extras.containsKey(START_CHAR_TOKEN))
|
|
|
|
|
name.setText("" + extras.getChar(START_CHAR_TOKEN));
|
|
|
|
|
} else {
|
|
|
|
|
FlurryAgent.onEvent("edit-task");
|
|
|
|
|
name.setText(model.getName());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (model.getName().length() > 0)
|
|
|
|
|
setTitle(new StringBuilder().append(r.getString(R.string.taskEdit_titlePrefix)).append(" ").append(
|
|
|
|
|
model.getName()));
|
|
|
|
|
if(model.getName().length() > 0)
|
|
|
|
|
setTitle(new StringBuilder().
|
|
|
|
|
append(r.getString(R.string.taskEdit_titlePrefix)).
|
|
|
|
|
append(" ").
|
|
|
|
|
append(model.getName()));
|
|
|
|
|
estimatedDuration.setTimeDuration(model.getEstimatedSeconds());
|
|
|
|
|
elapsedDuration.setTimeDuration(model.getElapsedSeconds());
|
|
|
|
|
importance.setImportance(model.getImportance());
|
|
|
|
|
@ -227,25 +227,26 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
notification.setTimeDuration(model.getNotificationIntervalSeconds());
|
|
|
|
|
flags.setValue(model.getNotificationFlags());
|
|
|
|
|
notes.setText(model.getNotes());
|
|
|
|
|
if (model.getTaskIdentifier() == null) {
|
|
|
|
|
if(model.getTaskIdentifier() == null) {
|
|
|
|
|
Integer reminder = Preferences.getDefaultReminder(this);
|
|
|
|
|
if (reminder != null)
|
|
|
|
|
notification.setTimeDuration(24 * 3600 * reminder);
|
|
|
|
|
if(reminder != null)
|
|
|
|
|
notification.setTimeDuration(24*3600*reminder);
|
|
|
|
|
}
|
|
|
|
|
if (model.getCalendarUri() != null)
|
|
|
|
|
if(model.getCalendarUri() != null)
|
|
|
|
|
addToCalendar.setText(r.getString(R.string.showCalendar_label));
|
|
|
|
|
|
|
|
|
|
// tags (only configure if not already set)
|
|
|
|
|
if (tagsContainer.getChildCount() == 0) {
|
|
|
|
|
if(tagsContainer.getChildCount() == 0) {
|
|
|
|
|
tags = tagController.getAllTags();
|
|
|
|
|
if (model.getTaskIdentifier() != null) {
|
|
|
|
|
if(model.getTaskIdentifier() != null) {
|
|
|
|
|
taskTags = tagController.getTaskTags(model.getTaskIdentifier());
|
|
|
|
|
if (taskTags.size() > 0) {
|
|
|
|
|
Map<TagIdentifier, TagModelForView> tagsMap = new HashMap<TagIdentifier, TagModelForView>();
|
|
|
|
|
for (TagModelForView tag : tags)
|
|
|
|
|
if(taskTags.size() > 0) {
|
|
|
|
|
Map<TagIdentifier, TagModelForView> tagsMap =
|
|
|
|
|
new HashMap<TagIdentifier, TagModelForView>();
|
|
|
|
|
for(TagModelForView tag : tags)
|
|
|
|
|
tagsMap.put(tag.getTagIdentifier(), tag);
|
|
|
|
|
for (TagIdentifier id : taskTags) {
|
|
|
|
|
if (!tagsMap.containsKey(id))
|
|
|
|
|
for(TagIdentifier id : taskTags) {
|
|
|
|
|
if(!tagsMap.containsKey(id))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
TagModelForView tag = tagsMap.get(id);
|
|
|
|
|
@ -256,7 +257,7 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
taskTags = new LinkedList<TagIdentifier>();
|
|
|
|
|
|
|
|
|
|
Bundle extras = getIntent().getExtras();
|
|
|
|
|
if (extras != null && extras.containsKey(TAG_NAME_TOKEN)) {
|
|
|
|
|
if(extras != null && extras.containsKey(TAG_NAME_TOKEN)) {
|
|
|
|
|
addTag(extras.getString(TAG_NAME_TOKEN));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -264,16 +265,16 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// alerts
|
|
|
|
|
if (model.getTaskIdentifier() != null) {
|
|
|
|
|
if(model.getTaskIdentifier() != null) {
|
|
|
|
|
List<Date> alerts = alertController.getTaskAlerts(model.getTaskIdentifier());
|
|
|
|
|
for (Date alert : alerts) {
|
|
|
|
|
for(Date alert : alerts) {
|
|
|
|
|
addAlert(alert);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// repeats
|
|
|
|
|
RepeatInfo repeatInfo = model.getRepeat();
|
|
|
|
|
if (repeatInfo != null) {
|
|
|
|
|
if(repeatInfo != null) {
|
|
|
|
|
setRepeatValue(repeatInfo.getValue());
|
|
|
|
|
repeatInterval.setSelection(repeatInfo.getInterval().ordinal());
|
|
|
|
|
} else
|
|
|
|
|
@ -284,7 +285,7 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
/** Save task model from values in UI components */
|
|
|
|
|
private void save() {
|
|
|
|
|
// don't save if user accidentally created a new task
|
|
|
|
|
if (name.getText().length() == 0)
|
|
|
|
|
if(name.getText().length() == 0)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
// tell the task list to update itself
|
|
|
|
|
@ -326,31 +327,29 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Displays a Toast reporting that the selected task has been saved and is
|
|
|
|
|
* due in 'x' amount of time, to 2 time-units of precision (e.g. Days +
|
|
|
|
|
* Hours).
|
|
|
|
|
*
|
|
|
|
|
* @param dueDate
|
|
|
|
|
* the Date when the task is due
|
|
|
|
|
* due in 'x' amount of time, to 2 time-units of precision (e.g. Days + Hours).
|
|
|
|
|
* @param dueDate the Date when the task is due
|
|
|
|
|
*/
|
|
|
|
|
private void showSaveToast(Date dueDate) {
|
|
|
|
|
int stringResource;
|
|
|
|
|
|
|
|
|
|
int timeInSeconds = (int) ((dueDate.getTime() - System.currentTimeMillis()) / 1000L);
|
|
|
|
|
int timeInSeconds = (int)((dueDate.getTime() - System.currentTimeMillis())/1000L);
|
|
|
|
|
|
|
|
|
|
if (timeInSeconds < 0) {
|
|
|
|
|
timeInSeconds *= -1; // DateUtilities.getDurationString() requires
|
|
|
|
|
// positive integer
|
|
|
|
|
timeInSeconds *= -1; // DateUtilities.getDurationString() requires positive integer
|
|
|
|
|
stringResource = R.string.taskEdit_onTaskSave_Overdue;
|
|
|
|
|
} else {
|
|
|
|
|
stringResource = R.string.taskEdit_onTaskSave_Due;
|
|
|
|
|
}
|
|
|
|
|
String formattedDate = DateUtilities.getDurationString(getResources(), timeInSeconds, 2);
|
|
|
|
|
Toast.makeText(this, getResources().getString(stringResource, formattedDate), Toast.LENGTH_SHORT).show();
|
|
|
|
|
Toast.makeText(this,
|
|
|
|
|
getResources().getString(stringResource, formattedDate),
|
|
|
|
|
Toast.LENGTH_SHORT).show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Displays a Toast reporting that the selected task has been saved. Use
|
|
|
|
|
* this version when no due Date has been set.
|
|
|
|
|
* Displays a Toast reporting that the selected task has been saved.
|
|
|
|
|
* Use this version when no due Date has been set.
|
|
|
|
|
*/
|
|
|
|
|
private void showSaveToast() {
|
|
|
|
|
Toast.makeText(this, R.string.taskEdit_onTaskSave_notDue, Toast.LENGTH_SHORT).show();
|
|
|
|
|
@ -362,9 +361,9 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
Set<TagIdentifier> tagsToAdd;
|
|
|
|
|
|
|
|
|
|
HashSet<String> tagNames = new HashSet<String>();
|
|
|
|
|
for (int i = 0; i < tagsContainer.getChildCount(); i++) {
|
|
|
|
|
TextView tagName = (TextView) tagsContainer.getChildAt(i).findViewById(R.id.text1);
|
|
|
|
|
if (tagName.getText().length() == 0)
|
|
|
|
|
for(int i = 0; i < tagsContainer.getChildCount(); i++) {
|
|
|
|
|
TextView tagName = (TextView)tagsContainer.getChildAt(i).findViewById(R.id.text1);
|
|
|
|
|
if(tagName.getText().length() == 0)
|
|
|
|
|
continue;
|
|
|
|
|
tagNames.add(tagName.getText().toString());
|
|
|
|
|
}
|
|
|
|
|
@ -372,10 +371,10 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
// map names to tag identifiers, creating them if necessary
|
|
|
|
|
HashSet<TagIdentifier> tagIds = new HashSet<TagIdentifier>();
|
|
|
|
|
HashMap<String, TagIdentifier> tagsByName = new HashMap<String, TagIdentifier>();
|
|
|
|
|
for (TagModelForView tag : tags)
|
|
|
|
|
for(TagModelForView tag : tags)
|
|
|
|
|
tagsByName.put(tag.getName(), tag.getTagIdentifier());
|
|
|
|
|
for (String tagName : tagNames) {
|
|
|
|
|
if (tagsByName.containsKey(tagName))
|
|
|
|
|
for(String tagName : tagNames) {
|
|
|
|
|
if(tagsByName.containsKey(tagName))
|
|
|
|
|
tagIds.add(tagsByName.get(tagName));
|
|
|
|
|
else {
|
|
|
|
|
TagIdentifier newTagId = tagController.createTag(tagName);
|
|
|
|
|
@ -390,12 +389,12 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
tagsToAdd.removeAll(taskTags);
|
|
|
|
|
|
|
|
|
|
// perform the database updates
|
|
|
|
|
for (TagIdentifier tagId : tagsToDelete)
|
|
|
|
|
for(TagIdentifier tagId : tagsToDelete)
|
|
|
|
|
tagController.removeTag(model.getTaskIdentifier(), tagId);
|
|
|
|
|
for (TagIdentifier tagId : tagsToAdd)
|
|
|
|
|
for(TagIdentifier tagId : tagsToAdd)
|
|
|
|
|
tagController.addTag(model.getTaskIdentifier(), tagId);
|
|
|
|
|
|
|
|
|
|
if (tagsToDelete.size() > 0 || tagsToAdd.size() > 0)
|
|
|
|
|
if(tagsToDelete.size() > 0 || tagsToAdd.size() > 0)
|
|
|
|
|
SyncDataController.taskUpdated(this, model);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -403,49 +402,54 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
private void saveAlerts() {
|
|
|
|
|
alertController.removeAlerts(model.getTaskIdentifier());
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < alertsContainer.getChildCount(); i++) {
|
|
|
|
|
DateControlSet dateControlSet = (DateControlSet) alertsContainer.getChildAt(i).getTag();
|
|
|
|
|
for(int i = 0; i < alertsContainer.getChildCount(); i++) {
|
|
|
|
|
DateControlSet dateControlSet = (DateControlSet)alertsContainer.
|
|
|
|
|
getChildAt(i).getTag();
|
|
|
|
|
Date date = dateControlSet.getDate();
|
|
|
|
|
alertController.addAlert(model.getTaskIdentifier(), date);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* ======================================================================
|
|
|
|
|
/* ======================================================================
|
|
|
|
|
* ==================================================== UI initialization
|
|
|
|
|
* ======================================================================
|
|
|
|
|
*/
|
|
|
|
|
* ====================================================================== */
|
|
|
|
|
|
|
|
|
|
/** Initialize UI components */
|
|
|
|
|
private void setUpUIComponents() {
|
|
|
|
|
Resources r = getResources();
|
|
|
|
|
setTitle(new StringBuilder().append(r.getString(R.string.taskEdit_titleGeneric)));
|
|
|
|
|
setTitle(new StringBuilder()
|
|
|
|
|
.append(r.getString(R.string.taskEdit_titleGeneric)));
|
|
|
|
|
|
|
|
|
|
// populate instance variables
|
|
|
|
|
name = (EditText) findViewById(R.id.name);
|
|
|
|
|
name = (EditText)findViewById(R.id.name);
|
|
|
|
|
importance = new ImportanceControlSet(R.id.importance_container);
|
|
|
|
|
tagsContainer = (LinearLayout) findViewById(R.id.tags_container);
|
|
|
|
|
estimatedDuration = new TimeDurationControlSet(this, R.id.estimatedDuration, 0, R.string.hour_minutes_dialog,
|
|
|
|
|
tagsContainer = (LinearLayout)findViewById(R.id.tags_container);
|
|
|
|
|
estimatedDuration = new TimeDurationControlSet(this,
|
|
|
|
|
R.id.estimatedDuration, 0, R.string.hour_minutes_dialog,
|
|
|
|
|
TimeDurationType.HOURS_MINUTES);
|
|
|
|
|
elapsedDuration = new TimeDurationControlSet(this, R.id.elapsedDuration, 0, R.string.hour_minutes_dialog,
|
|
|
|
|
elapsedDuration = new TimeDurationControlSet(this, R.id.elapsedDuration,
|
|
|
|
|
0, R.string.hour_minutes_dialog,
|
|
|
|
|
TimeDurationType.HOURS_MINUTES);
|
|
|
|
|
notification = new TimeDurationControlSet(this, R.id.notification, R.string.notification_prefix,
|
|
|
|
|
R.string.notification_dialog, TimeDurationType.DAYS_HOURS);
|
|
|
|
|
definiteDueDate = new DateWithNullControlSet(this, R.id.definiteDueDate_notnull, R.id.definiteDueDate_date,
|
|
|
|
|
R.id.definiteDueDate_time);
|
|
|
|
|
preferredDueDate = new DateWithNullControlSet(this, R.id.preferredDueDate_notnull, R.id.preferredDueDate_date,
|
|
|
|
|
R.id.preferredDueDate_time);
|
|
|
|
|
hiddenUntil = new DateWithNullControlSet(this, R.id.hiddenUntil_notnull, R.id.hiddenUntil_date,
|
|
|
|
|
R.id.hiddenUntil_time);
|
|
|
|
|
notes = (EditText) findViewById(R.id.notes);
|
|
|
|
|
flags = new NotifyFlagControlSet(R.id.flag_before, R.id.flag_during, R.id.flag_after, R.id.flag_nonstop);
|
|
|
|
|
alertsContainer = (LinearLayout) findViewById(R.id.alert_container);
|
|
|
|
|
repeatInterval = (Spinner) findViewById(R.id.repeat_interval);
|
|
|
|
|
repeatValue = (Button) findViewById(R.id.repeat_value);
|
|
|
|
|
addToCalendar = (CheckBox) findViewById(R.id.add_to_calendar);
|
|
|
|
|
notification = new TimeDurationControlSet(this, R.id.notification,
|
|
|
|
|
R.string.notification_prefix, R.string.notification_dialog,
|
|
|
|
|
TimeDurationType.DAYS_HOURS);
|
|
|
|
|
definiteDueDate = new DateWithNullControlSet(this, R.id.definiteDueDate_notnull,
|
|
|
|
|
R.id.definiteDueDate_date, R.id.definiteDueDate_time);
|
|
|
|
|
preferredDueDate = new DateWithNullControlSet(this, R.id.preferredDueDate_notnull,
|
|
|
|
|
R.id.preferredDueDate_date, R.id.preferredDueDate_time);
|
|
|
|
|
hiddenUntil = new DateWithNullControlSet(this, R.id.hiddenUntil_notnull,
|
|
|
|
|
R.id.hiddenUntil_date, R.id.hiddenUntil_time);
|
|
|
|
|
notes = (EditText)findViewById(R.id.notes);
|
|
|
|
|
flags = new NotifyFlagControlSet(R.id.flag_before,
|
|
|
|
|
R.id.flag_during, R.id.flag_after, R.id.flag_nonstop);
|
|
|
|
|
alertsContainer = (LinearLayout)findViewById(R.id.alert_container);
|
|
|
|
|
repeatInterval = (Spinner)findViewById(R.id.repeat_interval);
|
|
|
|
|
repeatValue = (Button)findViewById(R.id.repeat_value);
|
|
|
|
|
addToCalendar = (CheckBox)findViewById(R.id.add_to_calendar);
|
|
|
|
|
|
|
|
|
|
// individual ui component initialization
|
|
|
|
|
ArrayAdapter<String> repeatAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item,
|
|
|
|
|
ArrayAdapter<String> repeatAdapter = new ArrayAdapter<String>(
|
|
|
|
|
this, android.R.layout.simple_spinner_item,
|
|
|
|
|
RepeatInterval.getLabels(getResources()));
|
|
|
|
|
repeatAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
|
|
|
|
repeatInterval.setAdapter(repeatAdapter);
|
|
|
|
|
@ -474,7 +478,7 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
Button deleteButtonGeneral = (Button) findViewById(R.id.delete_general);
|
|
|
|
|
Button deleteButtonDates = (Button) findViewById(R.id.delete_dates);
|
|
|
|
|
Button deleteButtonNotify = (Button) findViewById(R.id.delete_notify);
|
|
|
|
|
if (model.getTaskIdentifier() == null) {
|
|
|
|
|
if(model.getTaskIdentifier() == null) {
|
|
|
|
|
deleteButtonGeneral.setVisibility(View.GONE);
|
|
|
|
|
deleteButtonDates.setVisibility(View.GONE);
|
|
|
|
|
deleteButtonNotify.setVisibility(View.GONE);
|
|
|
|
|
@ -500,7 +504,7 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
|
|
|
|
|
/** Set up the repeat value button */
|
|
|
|
|
private void setRepeatValue(int value) {
|
|
|
|
|
if (value == 0)
|
|
|
|
|
if(value == 0)
|
|
|
|
|
repeatValue.setText(R.string.repeat_value_unset);
|
|
|
|
|
else
|
|
|
|
|
repeatValue.setText(Integer.toString(value));
|
|
|
|
|
@ -508,28 +512,30 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private RepeatInfo getRepeatValue() {
|
|
|
|
|
if (repeatValue.getTag().equals(0))
|
|
|
|
|
if(repeatValue.getTag().equals(0))
|
|
|
|
|
return null;
|
|
|
|
|
return new RepeatInfo(RepeatInterval.values()[repeatInterval.getSelectedItemPosition()], (Integer) repeatValue
|
|
|
|
|
.getTag());
|
|
|
|
|
return new RepeatInfo(RepeatInterval.values()
|
|
|
|
|
[repeatInterval.getSelectedItemPosition()],
|
|
|
|
|
(Integer)repeatValue.getTag());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Adds an alert to the alert field */
|
|
|
|
|
private boolean addAlert(Date alert) {
|
|
|
|
|
if (alertsContainer.getChildCount() >= MAX_ALERTS)
|
|
|
|
|
if(alertsContainer.getChildCount() >= MAX_ALERTS)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
LayoutInflater inflater = getLayoutInflater();
|
|
|
|
|
final View alertItem = inflater.inflate(R.layout.edit_alert_item, null);
|
|
|
|
|
alertsContainer.addView(alertItem);
|
|
|
|
|
|
|
|
|
|
DateControlSet dcs = new DateControlSet(this, (Button) alertItem.findViewById(R.id.date), (Button) alertItem
|
|
|
|
|
.findViewById(R.id.time));
|
|
|
|
|
DateControlSet dcs = new DateControlSet(this,
|
|
|
|
|
(Button)alertItem.findViewById(R.id.date),
|
|
|
|
|
(Button)alertItem.findViewById(R.id.time));
|
|
|
|
|
dcs.setDate(alert);
|
|
|
|
|
alertItem.setTag(dcs);
|
|
|
|
|
|
|
|
|
|
ImageButton reminderRemoveButton;
|
|
|
|
|
reminderRemoveButton = (ImageButton) alertItem.findViewById(R.id.button1);
|
|
|
|
|
reminderRemoveButton = (ImageButton)alertItem.findViewById(R.id.button1);
|
|
|
|
|
reminderRemoveButton.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
alertsContainer.removeView(alertItem);
|
|
|
|
|
@ -549,14 +555,18 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
final View tagItem = inflater.inflate(R.layout.edit_tag_item, null);
|
|
|
|
|
tagsContainer.addView(tagItem);
|
|
|
|
|
|
|
|
|
|
AutoCompleteTextView textView = (AutoCompleteTextView) tagItem.findViewById(R.id.text1);
|
|
|
|
|
AutoCompleteTextView textView = (AutoCompleteTextView)tagItem.
|
|
|
|
|
findViewById(R.id.text1);
|
|
|
|
|
textView.setText(tagName);
|
|
|
|
|
ArrayAdapter<TagModelForView> tagsAdapter = new ArrayAdapter<TagModelForView>(this,
|
|
|
|
|
ArrayAdapter<TagModelForView> tagsAdapter =
|
|
|
|
|
new ArrayAdapter<TagModelForView>(this,
|
|
|
|
|
android.R.layout.simple_dropdown_item_1line, tags);
|
|
|
|
|
textView.setAdapter(tagsAdapter);
|
|
|
|
|
textView.addTextChangedListener(new TextWatcher() {
|
|
|
|
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
|
|
|
|
if (start == 0 && tagsContainer.getChildAt(tagsContainer.getChildCount() - 1) == tagItem) {
|
|
|
|
|
public void onTextChanged(CharSequence s, int start, int before,
|
|
|
|
|
int count) {
|
|
|
|
|
if(start == 0 && tagsContainer.getChildAt(
|
|
|
|
|
tagsContainer.getChildCount()-1) == tagItem) {
|
|
|
|
|
addTag("");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -565,13 +575,14 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
//
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
|
|
|
|
public void beforeTextChanged(CharSequence s, int start, int count,
|
|
|
|
|
int after) {
|
|
|
|
|
//
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
ImageButton reminderRemoveButton;
|
|
|
|
|
reminderRemoveButton = (ImageButton) tagItem.findViewById(R.id.button1);
|
|
|
|
|
reminderRemoveButton = (ImageButton)tagItem.findViewById(R.id.button1);
|
|
|
|
|
reminderRemoveButton.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
tagsContainer.removeView(tagItem);
|
|
|
|
|
@ -581,17 +592,15 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* ======================================================================
|
|
|
|
|
/* ======================================================================
|
|
|
|
|
* ======================================================= event handlers
|
|
|
|
|
* ======================================================================
|
|
|
|
|
*/
|
|
|
|
|
* ====================================================================== */
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onWindowFocusChanged(boolean hasFocus) {
|
|
|
|
|
super.onWindowFocusChanged(hasFocus);
|
|
|
|
|
|
|
|
|
|
if (hasFocus && TaskList.shouldCloseInstance) { // user wants to quit
|
|
|
|
|
if(hasFocus && TaskList.shouldCloseInstance) { // user wants to quit
|
|
|
|
|
finish();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -608,8 +617,11 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void deleteButtonClick() {
|
|
|
|
|
new AlertDialog.Builder(this).setTitle(R.string.delete_title).setMessage(R.string.delete_this_task_title)
|
|
|
|
|
.setIcon(android.R.drawable.ic_dialog_alert).setPositiveButton(android.R.string.ok,
|
|
|
|
|
new AlertDialog.Builder(this)
|
|
|
|
|
.setTitle(R.string.delete_title)
|
|
|
|
|
.setMessage(R.string.delete_this_task_title)
|
|
|
|
|
.setIcon(android.R.drawable.ic_dialog_alert)
|
|
|
|
|
.setPositiveButton(android.R.string.ok,
|
|
|
|
|
new DialogInterface.OnClickListener() {
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
// tell the task list to update itself
|
|
|
|
|
@ -620,12 +632,14 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
setResult(Constants.RESULT_GO_HOME);
|
|
|
|
|
finish();
|
|
|
|
|
}
|
|
|
|
|
}).setNegativeButton(android.R.string.cancel, null).show();
|
|
|
|
|
})
|
|
|
|
|
.setNegativeButton(android.R.string.cancel, null)
|
|
|
|
|
.show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void repeatValueClick() {
|
|
|
|
|
final int tagValue = (Integer) repeatValue.getTag();
|
|
|
|
|
if (tagValue > 0)
|
|
|
|
|
final int tagValue = (Integer)repeatValue.getTag();
|
|
|
|
|
if(tagValue > 0)
|
|
|
|
|
repeatHelpShown = true;
|
|
|
|
|
|
|
|
|
|
final Runnable openDialogRunnable = new Runnable() {
|
|
|
|
|
@ -633,39 +647,46 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
repeatHelpShown = true;
|
|
|
|
|
|
|
|
|
|
int dialogValue = tagValue;
|
|
|
|
|
if (dialogValue == 0)
|
|
|
|
|
if(dialogValue == 0)
|
|
|
|
|
dialogValue = 1;
|
|
|
|
|
|
|
|
|
|
new NumberPickerDialog(TaskEdit.this, new OnNumberPickedListener() {
|
|
|
|
|
public void onNumberPicked(NumberPicker view, int number) {
|
|
|
|
|
setRepeatValue(number);
|
|
|
|
|
}
|
|
|
|
|
}, getResources().getString(R.string.repeat_picker_title), dialogValue, 1, 0, 31).show();
|
|
|
|
|
}, getResources().getString(R.string.repeat_picker_title),
|
|
|
|
|
dialogValue, 1, 0, 31).show();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (repeatHelpShown || !Preferences.shouldShowRepeatHelp(this)) {
|
|
|
|
|
if(repeatHelpShown || !Preferences.shouldShowRepeatHelp(this)) {
|
|
|
|
|
openDialogRunnable.run();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
new AlertDialog.Builder(this).setTitle(R.string.repeat_help_dialog_title).setMessage(
|
|
|
|
|
R.string.repeat_help_dialog).setIcon(android.R.drawable.ic_dialog_info).setPositiveButton(
|
|
|
|
|
android.R.string.ok, new DialogInterface.OnClickListener() {
|
|
|
|
|
new AlertDialog.Builder(this)
|
|
|
|
|
.setTitle(R.string.repeat_help_dialog_title)
|
|
|
|
|
.setMessage(R.string.repeat_help_dialog)
|
|
|
|
|
.setIcon(android.R.drawable.ic_dialog_info)
|
|
|
|
|
.setPositiveButton(android.R.string.ok,
|
|
|
|
|
new DialogInterface.OnClickListener() {
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
openDialogRunnable.run();
|
|
|
|
|
}
|
|
|
|
|
}).setNeutralButton(R.string.repeat_help_hide, new DialogInterface.OnClickListener() {
|
|
|
|
|
})
|
|
|
|
|
.setNeutralButton(R.string.repeat_help_hide,
|
|
|
|
|
new DialogInterface.OnClickListener() {
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
Preferences.setShowRepeatHelp(TaskEdit.this, false);
|
|
|
|
|
openDialogRunnable.run();
|
|
|
|
|
}
|
|
|
|
|
}).show();
|
|
|
|
|
})
|
|
|
|
|
.show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean onMenuItemSelected(int featureId, MenuItem item) {
|
|
|
|
|
switch (item.getItemId()) {
|
|
|
|
|
switch(item.getItemId()) {
|
|
|
|
|
case SAVE_ID:
|
|
|
|
|
saveButtonClick();
|
|
|
|
|
return true;
|
|
|
|
|
@ -708,24 +729,21 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
|
|
|
|
|
// save the tag name token for when we rotate the screen
|
|
|
|
|
Bundle extras = getIntent().getExtras();
|
|
|
|
|
if (extras != null && extras.containsKey(TAG_NAME_TOKEN))
|
|
|
|
|
outState.putString(TAG_NAME_TOKEN, extras.getString(TAG_NAME_TOKEN));
|
|
|
|
|
if(extras != null && extras.containsKey(TAG_NAME_TOKEN))
|
|
|
|
|
outState.putString(TAG_NAME_TOKEN,
|
|
|
|
|
extras.getString(TAG_NAME_TOKEN));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Take the values from the model and set the calendar start and end times
|
|
|
|
|
/** Take the values from the model and set the calendar start and end times
|
|
|
|
|
* based on these. Sets keys 'dtstart' and 'dtend'.
|
|
|
|
|
*
|
|
|
|
|
* @param preferred
|
|
|
|
|
* preferred due date or null
|
|
|
|
|
* @param definite
|
|
|
|
|
* definite due date or null
|
|
|
|
|
* @param estimatedSeconds
|
|
|
|
|
* estimated duration or null
|
|
|
|
|
* @param preferred preferred due date or null
|
|
|
|
|
* @param definite definite due date or null
|
|
|
|
|
* @param estimatedSeconds estimated duration or null
|
|
|
|
|
* @param values
|
|
|
|
|
*/
|
|
|
|
|
public static void createCalendarStartEndTimes(Date preferred, Date definite, Integer estimatedSeconds,
|
|
|
|
|
ContentValues values) {
|
|
|
|
|
public static void createCalendarStartEndTimes(Date preferred, Date definite,
|
|
|
|
|
Integer estimatedSeconds, ContentValues values) {
|
|
|
|
|
FlurryAgent.onEvent("create-calendar-event");
|
|
|
|
|
|
|
|
|
|
Long deadlineDate = null;
|
|
|
|
|
@ -734,10 +752,10 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
else if (definite != null)
|
|
|
|
|
deadlineDate = definite.getTime();
|
|
|
|
|
else
|
|
|
|
|
deadlineDate = System.currentTimeMillis() + 24 * 3600 * 1000L;
|
|
|
|
|
deadlineDate = System.currentTimeMillis() + 24*3600*1000L;
|
|
|
|
|
|
|
|
|
|
int estimatedTime = DEFAULT_CAL_TIME;
|
|
|
|
|
if (estimatedSeconds != null && estimatedSeconds > 0) {
|
|
|
|
|
if(estimatedSeconds != null && estimatedSeconds > 0) {
|
|
|
|
|
estimatedTime = estimatedSeconds;
|
|
|
|
|
}
|
|
|
|
|
values.put("dtstart", deadlineDate - estimatedTime * 1000L);
|
|
|
|
|
@ -747,7 +765,7 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
@Override
|
|
|
|
|
protected void onPause() {
|
|
|
|
|
// create calendar event
|
|
|
|
|
if (addToCalendar.isChecked() && model.getCalendarUri() == null) {
|
|
|
|
|
if(addToCalendar.isChecked() && model.getCalendarUri() == null) {
|
|
|
|
|
Uri uri = Uri.parse("content://calendar/events");
|
|
|
|
|
ContentResolver cr = getContentResolver();
|
|
|
|
|
|
|
|
|
|
@ -759,26 +777,28 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
values.put("transparency", 0);
|
|
|
|
|
values.put("visibility", 0);
|
|
|
|
|
|
|
|
|
|
createCalendarStartEndTimes(model.getPreferredDueDate(), model.getDefiniteDueDate(), model
|
|
|
|
|
.getEstimatedSeconds(), values);
|
|
|
|
|
createCalendarStartEndTimes(model.getPreferredDueDate(),
|
|
|
|
|
model.getDefiniteDueDate(), model.getEstimatedSeconds(),
|
|
|
|
|
values);
|
|
|
|
|
|
|
|
|
|
Uri result = cr.insert(uri, values);
|
|
|
|
|
if (result != null)
|
|
|
|
|
if(result != null)
|
|
|
|
|
model.setCalendarUri(result.toString());
|
|
|
|
|
else
|
|
|
|
|
Log.e("astrid", "Error creating calendar event!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (shouldSaveState)
|
|
|
|
|
if(shouldSaveState)
|
|
|
|
|
save();
|
|
|
|
|
|
|
|
|
|
if (addToCalendar.isChecked() && model.getCalendarUri() != null) {
|
|
|
|
|
if(addToCalendar.isChecked() && model.getCalendarUri() != null) {
|
|
|
|
|
Uri result = Uri.parse(model.getCalendarUri());
|
|
|
|
|
Intent intent = new Intent(Intent.ACTION_EDIT, result);
|
|
|
|
|
|
|
|
|
|
ContentValues values = new ContentValues();
|
|
|
|
|
createCalendarStartEndTimes(model.getPreferredDueDate(), model.getDefiniteDueDate(), model
|
|
|
|
|
.getEstimatedSeconds(), values);
|
|
|
|
|
createCalendarStartEndTimes(model.getPreferredDueDate(),
|
|
|
|
|
model.getDefiniteDueDate(), model.getEstimatedSeconds(),
|
|
|
|
|
values);
|
|
|
|
|
|
|
|
|
|
intent.putExtra("beginTime", values.getAsLong("dtstart"));
|
|
|
|
|
intent.putExtra("endTime", values.getAsLong("dtend"));
|
|
|
|
|
@ -802,39 +822,42 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
alertController.close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* ======================================================================
|
|
|
|
|
/* ======================================================================
|
|
|
|
|
* ========================================== UI component helper classes
|
|
|
|
|
* ======================================================================
|
|
|
|
|
*/
|
|
|
|
|
* ====================================================================== */
|
|
|
|
|
|
|
|
|
|
/** Control set dealing with notification flags */
|
|
|
|
|
public class NotifyFlagControlSet {
|
|
|
|
|
private CheckBox before, during, after, nonstop;
|
|
|
|
|
|
|
|
|
|
public NotifyFlagControlSet(int beforeId, int duringId, int afterId, int nonstopId) {
|
|
|
|
|
before = (CheckBox) findViewById(beforeId);
|
|
|
|
|
during = (CheckBox) findViewById(duringId);
|
|
|
|
|
after = (CheckBox) findViewById(afterId);
|
|
|
|
|
nonstop = (CheckBox) findViewById(nonstopId);
|
|
|
|
|
public NotifyFlagControlSet(int beforeId, int duringId,
|
|
|
|
|
int afterId, int nonstopId) {
|
|
|
|
|
before = (CheckBox)findViewById(beforeId);
|
|
|
|
|
during = (CheckBox)findViewById(duringId);
|
|
|
|
|
after = (CheckBox)findViewById(afterId);
|
|
|
|
|
nonstop = (CheckBox)findViewById(nonstopId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setValue(int flags) {
|
|
|
|
|
before.setChecked((flags & TaskModelForEdit.NOTIFY_BEFORE_DEADLINE) > 0);
|
|
|
|
|
during.setChecked((flags & TaskModelForEdit.NOTIFY_AT_DEADLINE) > 0);
|
|
|
|
|
after.setChecked((flags & TaskModelForEdit.NOTIFY_AFTER_DEADLINE) > 0);
|
|
|
|
|
nonstop.setChecked((flags & TaskModelForEdit.NOTIFY_NONSTOP) > 0);
|
|
|
|
|
before.setChecked((flags &
|
|
|
|
|
TaskModelForEdit.NOTIFY_BEFORE_DEADLINE) > 0);
|
|
|
|
|
during.setChecked((flags &
|
|
|
|
|
TaskModelForEdit.NOTIFY_AT_DEADLINE) > 0);
|
|
|
|
|
after.setChecked((flags &
|
|
|
|
|
TaskModelForEdit.NOTIFY_AFTER_DEADLINE) > 0);
|
|
|
|
|
nonstop.setChecked((flags &
|
|
|
|
|
TaskModelForEdit.NOTIFY_NONSTOP) > 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getValue() {
|
|
|
|
|
int value = 0;
|
|
|
|
|
if (before.isChecked())
|
|
|
|
|
if(before.isChecked())
|
|
|
|
|
value |= TaskModelForEdit.NOTIFY_BEFORE_DEADLINE;
|
|
|
|
|
if (during.isChecked())
|
|
|
|
|
if(during.isChecked())
|
|
|
|
|
value |= TaskModelForEdit.NOTIFY_AT_DEADLINE;
|
|
|
|
|
if (after.isChecked())
|
|
|
|
|
if(after.isChecked())
|
|
|
|
|
value |= TaskModelForEdit.NOTIFY_AFTER_DEADLINE;
|
|
|
|
|
if (nonstop.isChecked())
|
|
|
|
|
if(nonstop.isChecked())
|
|
|
|
|
value |= TaskModelForEdit.NOTIFY_NONSTOP;
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
@ -845,19 +868,19 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
private List<CompoundButton> buttons = new LinkedList<CompoundButton>();
|
|
|
|
|
|
|
|
|
|
public ImportanceControlSet(int containerId) {
|
|
|
|
|
LinearLayout layout = (LinearLayout) findViewById(containerId);
|
|
|
|
|
LinearLayout layout = (LinearLayout)findViewById(containerId);
|
|
|
|
|
Resources r = getResources();
|
|
|
|
|
|
|
|
|
|
for (Importance i : Importance.values()) {
|
|
|
|
|
for(Importance i : Importance.values()) {
|
|
|
|
|
final ToggleButton button = new ToggleButton(TaskEdit.this);
|
|
|
|
|
button.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,
|
|
|
|
|
LayoutParams.WRAP_CONTENT, 1));
|
|
|
|
|
button.setLayoutParams(new LinearLayout.LayoutParams(
|
|
|
|
|
LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT, 1));
|
|
|
|
|
button.setTextColor(r.getColor(i.getColorResource()));
|
|
|
|
|
button.setTextOff(r.getString(i.getLabelResource()));
|
|
|
|
|
button.setTextOn(r.getString(i.getLabelResource()));
|
|
|
|
|
button.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
setImportance((Importance) button.getTag());
|
|
|
|
|
setImportance((Importance)button.getTag());
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
button.setTag(i);
|
|
|
|
|
@ -868,8 +891,8 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setImportance(Importance i) {
|
|
|
|
|
for (CompoundButton b : buttons) {
|
|
|
|
|
if (b.getTag() == i) {
|
|
|
|
|
for(CompoundButton b : buttons) {
|
|
|
|
|
if(b.getTag() == i) {
|
|
|
|
|
b.setTextSize(24);
|
|
|
|
|
b.setChecked(true);
|
|
|
|
|
} else {
|
|
|
|
|
@ -880,9 +903,9 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Importance getImportance() {
|
|
|
|
|
for (CompoundButton b : buttons)
|
|
|
|
|
if (b.isChecked())
|
|
|
|
|
return (Importance) b.getTag();
|
|
|
|
|
for(CompoundButton b : buttons)
|
|
|
|
|
if(b.isChecked())
|
|
|
|
|
return (Importance)b.getTag();
|
|
|
|
|
return Importance.DEFAULT;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -894,18 +917,21 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
private Spinner taskBox;
|
|
|
|
|
|
|
|
|
|
public BlockingOnControlSet(int checkBoxId, int taskBoxId) {
|
|
|
|
|
activatedCheckBox = (CheckBox) findViewById(checkBoxId);
|
|
|
|
|
taskBox = (Spinner) findViewById(taskBoxId);
|
|
|
|
|
activatedCheckBox = (CheckBox)findViewById(checkBoxId);
|
|
|
|
|
taskBox = (Spinner)findViewById(taskBoxId);
|
|
|
|
|
|
|
|
|
|
Cursor tasks = controller.getActiveTaskListCursor();
|
|
|
|
|
startManagingCursor(tasks);
|
|
|
|
|
SimpleCursorAdapter tasksAdapter = new SimpleCursorAdapter(TaskEdit.this,
|
|
|
|
|
android.R.layout.simple_list_item_1, tasks, new String[] { TaskModelForList.getNameField() },
|
|
|
|
|
android.R.layout.simple_list_item_1, tasks,
|
|
|
|
|
new String[] { TaskModelForList.getNameField() },
|
|
|
|
|
new int[] { android.R.id.text1 });
|
|
|
|
|
taskBox.setAdapter(tasksAdapter);
|
|
|
|
|
|
|
|
|
|
activatedCheckBox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
|
|
|
|
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
|
|
|
|
activatedCheckBox.setOnCheckedChangeListener(
|
|
|
|
|
new OnCheckedChangeListener() {
|
|
|
|
|
public void onCheckedChanged(CompoundButton buttonView,
|
|
|
|
|
boolean isChecked) {
|
|
|
|
|
taskBox.setEnabled(isChecked);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
@ -914,12 +940,12 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
|
|
|
|
|
public void setBlockingOn(TaskIdentifier value) {
|
|
|
|
|
activatedCheckBox.setChecked(value != null);
|
|
|
|
|
if (value == null) {
|
|
|
|
|
if(value == null) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < taskBox.getCount(); i++)
|
|
|
|
|
if (taskBox.getItemIdAtPosition(i) == value.getId()) {
|
|
|
|
|
for(int i = 0; i < taskBox.getCount(); i++)
|
|
|
|
|
if(taskBox.getItemIdAtPosition(i) == value.getId()) {
|
|
|
|
|
taskBox.setSelection(i);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
@ -929,7 +955,7 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public TaskIdentifier getBlockingOn() {
|
|
|
|
|
if (!activatedCheckBox.isChecked())
|
|
|
|
|
if(!activatedCheckBox.isChecked())
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
return new TaskIdentifier(taskBox.getSelectedItemId());
|
|
|
|
|
|