1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 11:42:16 -05:00

first pass of converting chips to colored circles

This commit is contained in:
Jesse Vincent 2012-09-10 10:40:20 -04:00
parent 4718dd56ba
commit 78cf804aca
5 changed files with 29 additions and 36 deletions

View File

@ -14,10 +14,10 @@
<View
android:id="@+id/chip"
android:layout_width="6dip"
android:layout_height="fill_parent"
android:layout_marginTop="2dip"
android:layout_marginBottom="1dip"
android:layout_width="16dip"
android:layout_height="16dip"
android:layout_marginLeft="8dip"
android:layout_marginRight="6dip"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:background="@android:color/transparent" />

View File

@ -12,10 +12,12 @@
<View
android:id="@+id/chip"
android:layout_width="6dip"
android:layout_width="16dip"
android:layout_marginTop="2dip"
android:layout_marginBottom="1dip"
android:layout_height="fill_parent"
android:layout_height="16dip"
android:layout_marginLeft="8dip"
android:layout_marginRight="6dip"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true" />

View File

@ -12,30 +12,27 @@
<RelativeLayout
android:id="@+id/chip"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:minHeight="38dip"
android:layout_width="16dip"
android:layout_height="16dip"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_marginRight="2dip"
android:layout_marginRight="0dip"
android:layout_marginLeft="6dip"
android:background="@android:color/transparent" >
</RelativeLayout>
<View
android:layout_width="6dip"
android:layout_height="fill_parent" />
<CheckBox
android:id="@+id/selected_checkbox"
android:layout_width="24dip"
android:layout_width="30dip"
android:paddingRight="5dip"
android:paddingLeft="7dip"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:button="@drawable/checkbox"
android:focusable="false"
android:visibility="gone" />
</RelativeLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"

View File

@ -10,30 +10,29 @@
<RelativeLayout
android:id="@+id/chip"
android:layout_width="wrap_content"
android:minWidth="6dip"
android:layout_height="fill_parent"
android:layout_width="16dip"
android:layout_height="16dip"
android:layout_alignTop="@+id/subject"
android:layout_alignBottom="@+id/preview"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_marginTop="6dip"
android:layout_marginRight="8dip"
android:paddingLeft="6dip"
android:layout_marginLeft="8dip"
android:background="@android:color/transparent" >
</RelativeLayout>
<CheckBox
android:id="@+id/selected_checkbox"
android:layout_width="30dip"
android:layout_height="fill_parent"
android:layout_centerVertical="true"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:paddingRight="4dip"
android:button="@drawable/checkbox"
android:paddingRight="7dip"
android:paddingLeft="7dip"
android:paddingBottom="6dip"
android:focusable="false"
android:visibility="gone" />
</RelativeLayout>
<TextView
android:id="@+id/date"
android:layout_width="wrap_content"
@ -65,7 +64,7 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/date"
android:layout_toRightOf="@+id/chip"
android:layout_toRightOf="@+id/selected_checkbox"
android:layout_marginLeft="1dip"
android:layout_marginRight="1dip"
android:paddingBottom="1dip"
@ -80,7 +79,7 @@
android:layout_height="wrap_content"
android:layout_below="@+id/subject"
android:layout_toLeftOf="@+id/flagged"
android:layout_toRightOf="@+id/chip"
android:layout_toRightOf="@+id/selected_checkbox"
android:layout_marginLeft="1dip"
android:layout_marginRight="0dip"
android:singleLine="false"

View File

@ -9,12 +9,7 @@ public class ColorChip {
static {
CHIP_PATH.lineTo(6, 0);
CHIP_PATH.cubicTo(8f, 0f, 10f, 0f, 10f, 2f);
CHIP_PATH.lineTo(10, 8);
CHIP_PATH.cubicTo(10f, 9f, 10f, 10f, 6f, 10f);
CHIP_PATH.lineTo(0, 10);
CHIP_PATH.addCircle(8,8,8f,Path.Direction.CW);
CHIP_PATH.close();
}
@ -23,7 +18,7 @@ public class ColorChip {
public ColorChip(int color) {
mDrawable = new ShapeDrawable(new PathShape(CHIP_PATH, 10, 10));
mDrawable = new ShapeDrawable(new PathShape(CHIP_PATH, 16f, 16f));
mDrawable.getPaint().setColor(color);