|
|
@ -54,6 +54,7 @@ import android.view.animation.ScaleAnimation;
|
|
|
|
import android.widget.CheckBox;
|
|
|
|
import android.widget.CheckBox;
|
|
|
|
import android.widget.CursorAdapter;
|
|
|
|
import android.widget.CursorAdapter;
|
|
|
|
import android.widget.Filterable;
|
|
|
|
import android.widget.Filterable;
|
|
|
|
|
|
|
|
import android.widget.ImageView;
|
|
|
|
import android.widget.LinearLayout;
|
|
|
|
import android.widget.LinearLayout;
|
|
|
|
import android.widget.ListView;
|
|
|
|
import android.widget.ListView;
|
|
|
|
import android.widget.RelativeLayout;
|
|
|
|
import android.widget.RelativeLayout;
|
|
|
@ -129,6 +130,14 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
|
|
|
|
R.drawable.importance_check_4, //task_indicator_3,
|
|
|
|
R.drawable.importance_check_4, //task_indicator_3,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static int[] IMPORTANCE_RESOURCES_LARGE = new int[] {
|
|
|
|
|
|
|
|
R.drawable.check_box_large_1, //task_indicator_0,
|
|
|
|
|
|
|
|
R.drawable.check_box_large_2, //task_indicator_1,
|
|
|
|
|
|
|
|
R.drawable.check_box_large_3, //task_indicator_2,
|
|
|
|
|
|
|
|
R.drawable.check_box_large_4, //task_indicator_3,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
public static int[] IMPORTANCE_REPEAT_RESOURCES = new int[] {
|
|
|
|
public static int[] IMPORTANCE_REPEAT_RESOURCES = new int[] {
|
|
|
|
R.drawable.importance_check_repeat_1, //task_indicator_0,
|
|
|
|
R.drawable.importance_check_repeat_1, //task_indicator_0,
|
|
|
|
R.drawable.importance_check_repeat_2, //task_indicator_1,
|
|
|
|
R.drawable.importance_check_repeat_2, //task_indicator_1,
|
|
|
@ -250,7 +259,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
|
|
|
|
viewHolder.rowBody = (ViewGroup)view.findViewById(R.id.rowBody);
|
|
|
|
viewHolder.rowBody = (ViewGroup)view.findViewById(R.id.rowBody);
|
|
|
|
viewHolder.nameView = (TextView)view.findViewById(R.id.title);
|
|
|
|
viewHolder.nameView = (TextView)view.findViewById(R.id.title);
|
|
|
|
viewHolder.picture = (AsyncImageView)view.findViewById(R.id.picture);
|
|
|
|
viewHolder.picture = (AsyncImageView)view.findViewById(R.id.picture);
|
|
|
|
viewHolder.pictureContainer = (View) view.findViewById(R.id.pictureContainer);
|
|
|
|
viewHolder.pictureBorder = (ImageView)view.findViewById(R.id.pictureBorder);
|
|
|
|
viewHolder.completeBox = (CheckBox)view.findViewById(R.id.completeBox);
|
|
|
|
viewHolder.completeBox = (CheckBox)view.findViewById(R.id.completeBox);
|
|
|
|
viewHolder.dueDate = (TextView)view.findViewById(R.id.dueDate);
|
|
|
|
viewHolder.dueDate = (TextView)view.findViewById(R.id.dueDate);
|
|
|
|
viewHolder.details1 = (TextView)view.findViewById(R.id.details1);
|
|
|
|
viewHolder.details1 = (TextView)view.findViewById(R.id.details1);
|
|
|
@ -304,7 +313,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
|
|
|
|
public TextView nameView;
|
|
|
|
public TextView nameView;
|
|
|
|
public CheckBox completeBox;
|
|
|
|
public CheckBox completeBox;
|
|
|
|
public AsyncImageView picture;
|
|
|
|
public AsyncImageView picture;
|
|
|
|
public View pictureContainer;
|
|
|
|
public ImageView pictureBorder;
|
|
|
|
public TextView dueDate;
|
|
|
|
public TextView dueDate;
|
|
|
|
public TextView details1, details2;
|
|
|
|
public TextView details1, details2;
|
|
|
|
public LinearLayout taskRow;
|
|
|
|
public LinearLayout taskRow;
|
|
|
@ -369,10 +378,10 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
|
|
|
|
final AsyncImageView pictureView = viewHolder.picture; {
|
|
|
|
final AsyncImageView pictureView = viewHolder.picture; {
|
|
|
|
if(task.getValue(Task.USER_ID) == 0) {
|
|
|
|
if(task.getValue(Task.USER_ID) == 0) {
|
|
|
|
pictureView.setVisibility(View.GONE);
|
|
|
|
pictureView.setVisibility(View.GONE);
|
|
|
|
viewHolder.pictureContainer.setVisibility(View.GONE);
|
|
|
|
viewHolder.pictureBorder.setVisibility(View.GONE);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
pictureView.setVisibility(View.VISIBLE);
|
|
|
|
pictureView.setVisibility(View.VISIBLE);
|
|
|
|
viewHolder.pictureContainer.setVisibility(View.VISIBLE);
|
|
|
|
viewHolder.pictureBorder.setVisibility(View.VISIBLE);
|
|
|
|
pictureView.setUrl(null);
|
|
|
|
pictureView.setUrl(null);
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
JSONObject user = new JSONObject(task.getValue(Task.USER));
|
|
|
|
JSONObject user = new JSONObject(task.getValue(Task.USER));
|
|
|
@ -390,13 +399,12 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
|
|
|
|
value = IMPORTANCE_RESOURCES.length - 1;
|
|
|
|
value = IMPORTANCE_RESOURCES.length - 1;
|
|
|
|
if (!TextUtils.isEmpty(task.getValue(Task.RECURRENCE))) {
|
|
|
|
if (!TextUtils.isEmpty(task.getValue(Task.RECURRENCE))) {
|
|
|
|
checkBoxView.setButtonDrawable(IMPORTANCE_REPEAT_RESOURCES[value]);
|
|
|
|
checkBoxView.setButtonDrawable(IMPORTANCE_REPEAT_RESOURCES[value]);
|
|
|
|
pictureView.setBackgroundResource(IMPORTANCE_REPEAT_RESOURCES[value]);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
checkBoxView.setButtonDrawable(IMPORTANCE_RESOURCES[value]);
|
|
|
|
checkBoxView.setButtonDrawable(IMPORTANCE_RESOURCES[value]);
|
|
|
|
pictureView.setBackgroundResource(IMPORTANCE_RESOURCES[value]);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (pictureView.getVisibility() == View.VISIBLE) {
|
|
|
|
if (pictureView.getVisibility() == View.VISIBLE) {
|
|
|
|
checkBoxView.setVisibility(View.INVISIBLE);
|
|
|
|
checkBoxView.setVisibility(View.INVISIBLE);
|
|
|
|
|
|
|
|
viewHolder.pictureBorder.setBackgroundResource(IMPORTANCE_RESOURCES[value]);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
checkBoxView.setVisibility(View.VISIBLE);
|
|
|
|
checkBoxView.setVisibility(View.VISIBLE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|