Made the anyone icon orange to contrast with blue, and use it for tasks assigned to anyone

pull/14/head
Tim Su 13 years ago
parent bc248a7e07
commit 9617085cd2

@ -77,4 +77,8 @@ public class TaskRabbitTaskContainer extends SyncContainer {
public void setRemoteTaskData(String taskData) {
trTask.setValue(TaskRabbitMetadata.DATA_REMOTE, taskData);
}
public boolean isTaskRabbit() {
return getTaskID() > 0;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

@ -414,7 +414,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
if (pictureView != null) {
TaskRabbitTaskContainer container = TaskRabbitDataService.getInstance().getContainerForTask(task);
if(task.getValue(Task.USER_ID) == 0 && container.getTaskID() <= 0) {
if(task.getValue(Task.USER_ID) == Task.USER_ID_SELF && !container.isTaskRabbit()) {
pictureView.setVisibility(View.GONE);
if (viewHolder.pictureBorder != null)
viewHolder.pictureBorder.setVisibility(View.GONE);
@ -423,17 +423,18 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
if (viewHolder.pictureBorder != null)
viewHolder.pictureBorder.setVisibility(View.VISIBLE);
pictureView.setUrl(null);
if (container.getTaskID() > 0) {
if (container.isTaskRabbit()) {
pictureView.setDefaultImageResource(R.drawable.task_rabbit_image);
}
} else if(task.getValue(Task.USER_ID) == Task.USER_ID_UNASSIGNED)
pictureView.setDefaultImageResource(R.drawable.icn_anyone);
else {
pictureView.setDefaultImageResource(R.drawable.icn_default_person_image);
try {
JSONObject user = new JSONObject(task.getValue(Task.USER));
pictureView.setUrl(user.optString("picture")); //$NON-NLS-1$
} catch (JSONException e) {
Log.w("astrid", "task-adapter-image", e); //$NON-NLS-1$ //$NON-NLS-2$
}
try {
JSONObject user = new JSONObject(task.getValue(Task.USER));
pictureView.setUrl(user.optString("picture")); //$NON-NLS-1$
} catch (JSONException e) {
Log.w("astrid", "task-adapter-image", e); //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
}

Loading…
Cancel
Save