do it this way
Put this in your XML
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="50dp" android:orientation="horizontal" > <View android:layout_width="5dp" android:layout_height="wrap_content" android:background="#CC3333" /> <RelativeLayout android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:background="#808080" > <View android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentLeft="true" android:layout_marginLeft="1dp" android:background="@drawable/red_background" /> <View android:layout_width="10dp" android:layout_height="10dp" android:layout_centerHorizontal="true" android:background="@drawable/red_background" /> <View android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentRight="true" android:background="@drawable/red_background" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:gravity="center" android:text="1" android:textColor="@android:color/black" /> <View android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_marginLeft="1dp" android:background="@drawable/red_background" /> <View android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:background="@drawable/red_background" /> <View android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:background="@drawable/red_background" /> </RelativeLayout> <View android:layout_width="1dp" android:layout_height="wrap_content" android:background="#1D1D1D" /> <RelativeLayout android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:background="#808080" > <View android:id="@+id/box1" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentLeft="true" android:layout_marginLeft="1dp" android:background="@drawable/red_background" /> <View android:id="@+id/box2" android:layout_width="10dp" android:layout_height="10dp" android:layout_marginLeft="2dp" android:layout_toRightOf="@+id/box1" android:background="@drawable/red_background" /> <View android:id="@+id/box3" android:layout_width="10dp" android:layout_height="10dp" android:layout_marginRight="2dp" android:layout_toLeftOf="@+id/box4" android:background="@drawable/red_background" /> <View android:id="@+id/box4" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentRight="true" android:background="#CC3333" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:gravity="center" android:text="2" android:textColor="@android:color/black" /> <View android:id="@+id/box5" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:background="@drawable/red_background" /> <View android:id="@+id/box6" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentBottom="true" android:layout_marginLeft="2dp" android:layout_toRightOf="@+id/box5" android:background="@drawable/red_background" /> <View android:id="@+id/box7" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentBottom="true" android:layout_marginRight="2dp" android:layout_toLeftOf="@+id/box8" android:background="@drawable/red_background" /> <View android:id="@+id/box8" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:background="@drawable/red_background" /> </RelativeLayout> <View android:layout_width="1dp" android:layout_height="wrap_content" android:background="#1D1D1D" /> <RelativeLayout android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:background="#808080" > <View android:id="@+id/box1" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentLeft="true" android:layout_marginLeft="1dp" android:background="@drawable/red_background" /> <View android:id="@+id/box2" android:layout_width="10dp" android:layout_height="10dp" android:layout_marginLeft="2dp" android:layout_toRightOf="@+id/box1" android:background="@drawable/red_background" /> <View android:id="@+id/box3" android:layout_width="10dp" android:layout_height="10dp" android:layout_marginRight="2dp" android:layout_toLeftOf="@+id/box4" android:background="@drawable/red_background" /> <View android:id="@+id/box4" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentRight="true" android:background="@drawable/red_background" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:gravity="center" android:text="3" android:textColor="@android:color/black" /> <View android:id="@+id/box5" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:background="@drawable/red_background" /> <View android:id="@+id/box6" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentBottom="true" android:layout_marginLeft="2dp" android:layout_toRightOf="@+id/box5" android:background="@drawable/red_background" /> <View android:id="@+id/box7" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentBottom="true" android:layout_marginRight="2dp" android:layout_toLeftOf="@+id/box8" android:background="@drawable/red_background" /> <View android:id="@+id/box8" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:background="@drawable/red_background" /> </RelativeLayout> <View android:layout_width="1dp" android:layout_height="wrap_content" android:background="#1D1D1D" /> <RelativeLayout android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:background="#808080" > <View android:id="@+id/box1" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentLeft="true" android:layout_marginLeft="1dp" android:background="@drawable/red_background" /> <View android:id="@+id/box2" android:layout_width="10dp" android:layout_height="10dp" android:layout_marginLeft="2dp" android:layout_toRightOf="@+id/box1" android:background="@drawable/red_background" /> <View android:id="@+id/box3" android:layout_width="10dp" android:layout_height="10dp" android:layout_marginRight="2dp" android:layout_toLeftOf="@+id/box4" android:background="@drawable/red_background" /> <View android:id="@+id/box4" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentRight="true" android:background="@drawable/red_background" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:gravity="center" android:text="4" android:textColor="@android:color/black" /> <View android:id="@+id/box5" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:background="@drawable/red_background" /> <View android:id="@+id/box6" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentBottom="true" android:layout_marginLeft="2dp" android:layout_toRightOf="@+id/box5" android:background="@drawable/red_background" /> <View android:id="@+id/box7" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentBottom="true" android:layout_marginRight="2dp" android:layout_toLeftOf="@+id/box8" android:background="@drawable/red_background" /> <View android:id="@+id/box8" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:background="@drawable/red_background" /> </RelativeLayout> <View android:layout_width="1dp" android:layout_height="wrap_content" android:background="#1D1D1D" /> <RelativeLayout android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:background="#808080" > <View android:id="@+id/box1" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentLeft="true" android:layout_marginLeft="1dp" android:background="@drawable/red_background" /> <View android:id="@+id/box2" android:layout_width="10dp" android:layout_height="10dp" android:layout_marginLeft="2dp" android:layout_toRightOf="@+id/box1" android:background="@drawable/red_background" /> <View android:id="@+id/box3" android:layout_width="10dp" android:layout_height="10dp" android:layout_marginRight="2dp" android:layout_toLeftOf="@+id/box4" android:background="@drawable/red_background" /> <View android:id="@+id/box4" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentRight="true" android:background="@drawable/red_background" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:gravity="center" android:text="5" android:textColor="@android:color/black" /> <View android:id="@+id/box5" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:background="@drawable/red_background" /> <View android:id="@+id/box6" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentBottom="true" android:layout_marginLeft="2dp" android:layout_toRightOf="@+id/box5" android:background="@drawable/red_background" /> <View android:id="@+id/box7" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentBottom="true" android:layout_marginRight="2dp" android:layout_toLeftOf="@+id/box8" android:background="@drawable/red_background" /> <View android:id="@+id/box8" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:background="@drawable/red_background" /> </RelativeLayout> <View android:layout_width="1dp" android:layout_height="wrap_content" android:background="#1D1D1D" /> <RelativeLayout android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:background="#808080" > <View android:id="@+id/box1" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentLeft="true" android:layout_marginLeft="1dp" android:background="@drawable/red_background" /> <View android:id="@+id/box2" android:layout_width="10dp" android:layout_height="10dp" android:layout_marginLeft="2dp" android:layout_toRightOf="@+id/box1" android:background="@drawable/red_background" /> <View android:id="@+id/box3" android:layout_width="10dp" android:layout_height="10dp" android:layout_marginRight="2dp" android:layout_toLeftOf="@+id/box4" android:background="@drawable/red_background" /> <View android:id="@+id/box4" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentRight="true" android:background="@drawable/red_background" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:gravity="center" android:text="6" android:textColor="@android:color/black" /> <View android:id="@+id/box5" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:background="@drawable/red_background" /> <View android:id="@+id/box6" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentBottom="true" android:layout_marginLeft="2dp" android:layout_toRightOf="@+id/box5" android:background="@drawable/red_background" /> <View android:id="@+id/box7" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentBottom="true" android:layout_marginRight="2dp" android:layout_toLeftOf="@+id/box8" android:background="@drawable/red_background" /> <View android:id="@+id/box8" android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:background="@drawable/red_background" /> </RelativeLayout> <View android:layout_width="1dp" android:layout_height="wrap_content" android:background="#1D1D1D" /> <RelativeLayout android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:background="#808080" > <View android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentLeft="true" android:background="@drawable/red_background" /> <View android:layout_width="10dp" android:layout_height="10dp" android:layout_centerHorizontal="true" android:background="@drawable/red_background" /> <View android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentRight="true" android:layout_marginRight="1dp" android:background="@drawable/red_background" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:gravity="center" android:text="7" android:textColor="@android:color/black" /> <View android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:background="@drawable/red_background" /> <View android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:background="@drawable/red_background" /> <View android:layout_width="10dp" android:layout_height="10dp" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:layout_marginRight="1dp" android:background="@drawable/red_background" /> </RelativeLayout> <View android:layout_width="5dp" android:layout_height="wrap_content" android:background="#CC3333" /></LinearLayout>
for red rectangle.xml
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <solid android:color="@android:color/transparent" /> <stroke android:width="1dip" android:color="#CC3333" /></shape>



