Merge remote-tracking branch 'upstream/20120212_as_task_rabbit_bugs' into 4.0

pull/14/head
Sam Bosley 13 years ago
commit 3ad6251415

@ -118,7 +118,7 @@ public class EditPeopleControlSet extends PopupControlSet {
public boolean didPostToTaskRabbit(); public boolean didPostToTaskRabbit();
} }
int selected = 0; //need to remember last selected state for task rabbit private int selected = 0; //need to remember last selected state for task rabbit
static { static {
AstridDependencyInjector.initialize(); AstridDependencyInjector.initialize();
@ -401,7 +401,7 @@ public class EditPeopleControlSet extends PopupControlSet {
if (l.shouldShowTaskRabbit()) { if (l.shouldShowTaskRabbit()) {
taskRabbitUser = new AssignedToUser(activity.getString(R.string.actfm_EPA_task_rabbit), new JSONObject().put("default_picture", R.drawable.task_rabbit_image)); taskRabbitUser = new AssignedToUser(activity.getString(R.string.actfm_EPA_task_rabbit), new JSONObject().put("default_picture", R.drawable.task_rabbit_image));
listValues.add(taskRabbitUser); listValues.add(taskRabbitUser);
if(l.didPostToTaskRabbit() && assignedIndex <= 0){ if(l.didPostToTaskRabbit()){
assignedIndex = listValues.size()-1; assignedIndex = listValues.size()-1;
} }
} }
@ -548,9 +548,10 @@ public class EditPeopleControlSet extends PopupControlSet {
AssignedToUser item = (AssignedToUser) assignedList.getAdapter().getItem(assignedList.getCheckedItemPosition()); AssignedToUser item = (AssignedToUser) assignedList.getAdapter().getItem(assignedList.getCheckedItemPosition());
if (item != null) { if (item != null) {
if (item.equals(taskRabbitUser)) { //don't want to ever set the user as the task rabbit user if (item.equals(taskRabbitUser)) { //don't want to ever set the user as the task rabbit user
Log.d("Edit People control set", "Equals task rabbit");
item = (AssignedToUser) assignedList.getAdapter().getItem(0); /*item = (AssignedToUser) assignedList.getAdapter().getItem(0);
selected = 0; selected = 0;*/
return true;
} }
else { else {
Log.d("Edit People control set", "Does not equal task rabbit"); Log.d("Edit People control set", "Does not equal task rabbit");

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

@ -16,6 +16,8 @@
android:layout_height="45dip" android:layout_height="45dip"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:padding="2dip" android:padding="2dip"
android:paddingTop="1dip"
android:paddingLeft="1dip"
android:layout_marginLeft="5dip" android:layout_marginLeft="5dip"
astrid:defaultSrc="@drawable/icn_default_person_image" astrid:defaultSrc="@drawable/icn_default_person_image"
android:scaleType="fitCenter" android:scaleType="fitCenter"

@ -125,6 +125,7 @@ import com.todoroo.astrid.service.TaskService;
import com.todoroo.astrid.service.UpgradeService; import com.todoroo.astrid.service.UpgradeService;
import com.todoroo.astrid.sync.SyncResultCallback; import com.todoroo.astrid.sync.SyncResultCallback;
import com.todoroo.astrid.sync.SyncV2Provider; import com.todoroo.astrid.sync.SyncV2Provider;
import com.todoroo.astrid.taskrabbit.TaskRabbitControlSet;
import com.todoroo.astrid.ui.DateChangedAlerts; import com.todoroo.astrid.ui.DateChangedAlerts;
import com.todoroo.astrid.ui.DeadlineControlSet; import com.todoroo.astrid.ui.DeadlineControlSet;
import com.todoroo.astrid.utility.AstridPreferences; import com.todoroo.astrid.utility.AstridPreferences;
@ -250,6 +251,7 @@ public class TaskListFragment extends ListFragment implements OnScrollListener,
private RepeatControlSet repeatControl; private RepeatControlSet repeatControl;
private GCalControlSet gcalControl; private GCalControlSet gcalControl;
private EditPeopleControlSet peopleControl; private EditPeopleControlSet peopleControl;
private TaskRabbitControlSet taskRabbitControl;
/* /*
* ====================================================================== * ======================================================================
@ -652,11 +654,13 @@ public class TaskListFragment extends ListFragment implements OnScrollListener,
repeatControl.getDisplayView(), gcalControl.getDisplayView()); repeatControl.getDisplayView(), gcalControl.getDisplayView());
deadlineControl.setIsQuickadd(true); deadlineControl.setIsQuickadd(true);
peopleControl = new EditPeopleControlSet(getActivity(), this, peopleControl = new EditPeopleControlSet(getActivity(), this,
R.layout.control_set_assigned, R.layout.control_set_assigned,
R.layout.control_set_default_display, R.layout.control_set_default_display,
R.string.actfm_EPA_assign_label, TaskEditFragment.REQUEST_LOG_IN); R.string.actfm_EPA_assign_label, TaskEditFragment.REQUEST_LOG_IN);
resetControlSets(); resetControlSets();
LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT, 1.0f); LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT, 1.0f);

@ -82,6 +82,8 @@ import com.todoroo.astrid.notes.NotesDecorationExposer;
import com.todoroo.astrid.service.StatisticsConstants; import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService; import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.TaskService; import com.todoroo.astrid.service.TaskService;
import com.todoroo.astrid.taskrabbit.TaskRabbitDataService;
import com.todoroo.astrid.taskrabbit.TaskRabbitTaskContainer;
import com.todoroo.astrid.timers.TimerDecorationExposer; import com.todoroo.astrid.timers.TimerDecorationExposer;
import com.todoroo.astrid.utility.Constants; import com.todoroo.astrid.utility.Constants;
@ -391,7 +393,9 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
// image view // image view
final AsyncImageView pictureView = viewHolder.picture; { final AsyncImageView pictureView = viewHolder.picture; {
if (pictureView != null) { if (pictureView != null) {
if(task.getValue(Task.USER_ID) == 0) { TaskRabbitTaskContainer container = TaskRabbitDataService.getInstance().getContainerForTask(task);
if(task.getValue(Task.USER_ID) == 0 && container.getTaskID() <= 0) {
pictureView.setVisibility(View.GONE); pictureView.setVisibility(View.GONE);
if (viewHolder.pictureBorder != null) if (viewHolder.pictureBorder != null)
viewHolder.pictureBorder.setVisibility(View.GONE); viewHolder.pictureBorder.setVisibility(View.GONE);
@ -400,12 +404,18 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
if (viewHolder.pictureBorder != null) if (viewHolder.pictureBorder != null)
viewHolder.pictureBorder.setVisibility(View.VISIBLE); viewHolder.pictureBorder.setVisibility(View.VISIBLE);
pictureView.setUrl(null); pictureView.setUrl(null);
if (container.getTaskID() > 0) {
pictureView.setDefaultImageResource(R.drawable.task_rabbit_image);
}
else {
pictureView.setDefaultImageResource(R.drawable.icn_default_person_image);
try { try {
JSONObject user = new JSONObject(task.getValue(Task.USER)); JSONObject user = new JSONObject(task.getValue(Task.USER));
pictureView.setUrl(user.optString("picture")); //$NON-NLS-1$ pictureView.setUrl(user.optString("picture")); //$NON-NLS-1$
} catch (JSONException e) { } catch (JSONException e) {
Log.w("astrid", "task-adapter-image", e); //$NON-NLS-1$ //$NON-NLS-2$ Log.w("astrid", "task-adapter-image", e); //$NON-NLS-1$ //$NON-NLS-2$
} }
}
} }
} }
} }

Loading…
Cancel
Save