Styled checkbox for assigned tasks

pull/14/head
Andrew Shaw 13 years ago
parent d900f07563
commit 2c9e4126bc

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

@ -10,36 +10,39 @@
<!-- completion check-box --> <!-- completion check-box -->
<CheckBox
android:id="@+id/completeBox"
android:layout_width="45dip"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dip"
android:button="@drawable/btn_check" />
<!-- assignee photo -->
<LinearLayout
android:id="@+id/pictureContainer"
android:layout_width="58dip"
android:layout_height="54dip"
android:layout_marginLeft="5dip"
android:layout_marginTop="10dip"
android:padding="7dip"
android:paddingTop="9dip"
android:background="#111111"
>
<greendroid.widget.AsyncImageView <greendroid.widget.AsyncImageView
android:id="@+id/picture" android:id="@+id/picture"
android:layout_width="35dip" android:layout_width="35dip"
android:layout_height="35dip" android:layout_height="35dip"
android:layout_centerVertical="true"
android:padding="2dip"
android:layout_marginLeft="9dip"
astrid:defaultSrc="@drawable/icn_default_person_image" astrid:defaultSrc="@drawable/icn_default_person_image"
android:scaleType="fitCenter" android:scaleType="fitCenter"
android:visibility="gone" > android:visibility="gone" >
</greendroid.widget.AsyncImageView>
<ImageView
android:id="@+id/pictureBorder"
android:layout_width="50dip"
android:layout_height="44dip"
android:layout_marginLeft="6dip"
android:layout_centerVertical="true"
android:background="@drawable/icn_default_person_image"
android:scaleType="fitCenter"
android:visibility="gone" >
</ImageView>
</greendroid.widget.AsyncImageView>
</LinearLayout> <CheckBox
android:id="@+id/completeBox"
android:layout_width="45dip"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dip"
android:button="@drawable/btn_check" />
<!-- assignee photo -->
<LinearLayout <LinearLayout
@ -49,7 +52,7 @@
android:layout_alignTop="@id/completeBox" android:layout_alignTop="@id/completeBox"
android:layout_toRightOf="@id/completeBox" android:layout_toRightOf="@id/completeBox"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingLeft="5dip" > android:paddingLeft="2dip" >
<!-- task name --> <!-- task name -->

@ -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);
} }

Loading…
Cancel
Save