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 -->
<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
android:id="@+id/picture"
android:layout_width="35dip"
android:layout_height="35dip"
android:layout_centerVertical="true"
android:padding="2dip"
android:layout_marginLeft="9dip"
astrid:defaultSrc="@drawable/icn_default_person_image"
android:scaleType="fitCenter"
android:visibility="gone" >
</greendroid.widget.AsyncImageView>
</LinearLayout>
<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>
<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
@ -49,7 +52,7 @@
android:layout_alignTop="@id/completeBox"
android:layout_toRightOf="@id/completeBox"
android:orientation="horizontal"
android:paddingLeft="5dip" >
android:paddingLeft="2dip" >
<!-- task name -->

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

Loading…
Cancel
Save