Remove people from quick add control set

pull/14/head
Alex Baker 11 years ago
parent a353753ccf
commit 3902f967ee

@ -88,7 +88,6 @@ public class PersonViewFragment extends TaskListFragment {
@Override
protected void setupQuickAddBar() {
super.setupQuickAddBar();
quickAddBar.setUsePeopleControl(false);
if (user != null) {
quickAddBar.getQuickAddBox().setHint(getString(R.string.TLA_quick_add_hint_assign, user.getDisplayName()));
}

@ -79,8 +79,6 @@ public class QuickAddBar extends LinearLayout {
private DeadlineControlSet deadlineControl;
private RepeatControlSet repeatControl;
private GCalControlSet gcalControl;
private EditPeopleControlSet peopleControl;
private boolean usePeopleControl = true;
private String currentVoiceFile = null;
@ -215,11 +213,6 @@ public class QuickAddBar extends LinearLayout {
setUpQuickAddControlSets();
}
public void setUsePeopleControl(boolean usePeopleControl) {
this.usePeopleControl = usePeopleControl;
peopleControl.getDisplayView().setVisibility(usePeopleControl ? View.VISIBLE : View.GONE);
}
private void setUpQuickAddControlSets() {
repeatControl = new RepeatControlSet(activity,
@ -236,24 +229,14 @@ public class QuickAddBar extends LinearLayout {
repeatControl.getDisplayView(), gcalControl.getDisplayView());
deadlineControl.setIsQuickadd(true);
peopleControl = new EditPeopleControlSet(activity, fragment,
R.layout.control_set_assigned,
R.layout.control_set_default_display,
R.string.actfm_EPA_assign_label_long,
TaskEditFragment.REQUEST_LOG_IN);
resetControlSets();
LayoutParams lp = new LinearLayout.LayoutParams(
LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT, 1.0f);
View peopleDisplay = peopleControl.getDisplayView();
View deadlineDisplay = deadlineControl.getDisplayView();
quickAddControls.addView(peopleDisplay, 0, lp);
quickAddControls.addView(deadlineDisplay, 2, lp);
quickAddControls.addView(deadlineDisplay, 0, lp);
TextView tv = (TextView) deadlineDisplay.findViewById(R.id.display_row_edit);
tv.setGravity(Gravity.LEFT);
tv = (TextView) peopleDisplay.findViewById(R.id.display_row_edit);
tv.setGravity(Gravity.LEFT);
}
private void resetControlSets() {
@ -268,9 +251,6 @@ public class QuickAddBar extends LinearLayout {
gcalControl.readFromTask(empty);
gcalControl.resetCalendarSelector();
deadlineControl.readFromTask(empty);
peopleControl.setUpData(empty, fragment.getActiveTagData());
peopleControl.assignToMe();
peopleControl.setTask(null);
}
@ -295,11 +275,7 @@ public class QuickAddBar extends LinearLayout {
if (title != null) {
title = title.trim();
}
boolean assignedToMe = usePeopleControl ? peopleControl.willBeAssignedToMe() : true;
if (!assignedToMe && !actFmPreferenceService.isLoggedIn()) {
peopleControl.assignToMe();
return null;
}
boolean assignedToMe = true;
Task task = new Task();
if (title != null) {
@ -315,18 +291,10 @@ public class QuickAddBar extends LinearLayout {
TaskDao.createDefaultHideUntil(task);
}
gcalControl.writeToModel(task);
if (!assignedToMe) {
peopleControl.setTask(task);
peopleControl.saveSharingSettings(null);
}
TaskService.createWithValues(task, fragment.getFilter().valuesForNewTasks, title);
String assignedTo = peopleControl.getAssignedToString();
String assignedEmail = "";
String assignedId = task.getValue(Task.USER_ID);
if (Task.userIdIsEmail(task.getValue(Task.USER_ID))) {
assignedEmail = task.getValue(Task.USER_ID);
}
resetControlSets();
@ -336,10 +304,6 @@ public class QuickAddBar extends LinearLayout {
if(!TextUtils.isEmpty(title)) {
}
if (activity instanceof TaskListActivity && !assignedToMe) {
((TaskListActivity) activity).taskAssignedTo(assignedTo, assignedEmail, assignedId);
}
TextView quickAdd = (TextView) findViewById(R.id.quickAddText);
quickAdd.setText(""); //$NON-NLS-1$
@ -445,11 +409,6 @@ public class QuickAddBar extends LinearLayout {
// voicerecognition, so bail out
return true;
} else if (requestCode == TaskEditFragment.REQUEST_CODE_CONTACT) {
if (resultCode == Activity.RESULT_OK) {
peopleControl.onActivityResult(requestCode, resultCode, data);
} else {
peopleControl.assignToMe();
}
return true;
}

Loading…
Cancel
Save