Skip to content

Instantly share code, notes, and snippets.

@messenger63
Created February 12, 2015 15:00
Show Gist options
  • Save messenger63/b30c40b1bbf43bb66eee to your computer and use it in GitHub Desktop.
Save messenger63/b30c40b1bbf43bb66eee to your computer and use it in GitHub Desktop.
Tile view with same size views
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@android:color/transparent"
android:padding="5dp"
android:id="@+id/status"
android:orientation="horizontal"
android:visibility="visible"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<RelativeLayout
android:layout_weight="1"
android:layout_margin="5dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:id="@+id/btn_release"
android:background="@color/classification_chooser_background_release"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:textColor="@color/classification_chooser_label"
android:textStyle="bold"
android:textSize="20dp"
android:text="@string/view.classification_chooser_regular"
android:gravity="start|center_vertical"
android:layout_toStartOf="@+id/btn_release_img"
android:layout_toLeftOf="@+id/btn_release_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
<RelativeLayout
android:layout_weight="1"
android:layout_margin="5dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:id="@+id/btn_approve"
android:background="@color/classification_chooser_background_approve"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:textColor="@color/classification_chooser_label"
android:textStyle="bold"
android:textSize="20dp"
android:text="@string/view.classification_chooser_wanted"
android:gravity="start|center_vertical"
android:layout_toStartOf="@+id/btn_approve_img"
android:layout_toLeftOf="@+id/btn_approve_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
<RelativeLayout
android:layout_weight="1"
android:layout_margin="5dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:id="@+id/btn_spam"
android:background="@color/classification_chooser_background_spam"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:textColor="@color/classification_chooser_label"
android:textStyle="bold"
android:textSize="20dp"
android:text="@string/view.classification_chooser_spam"
android:gravity="start|center_vertical"
android:layout_toStartOf="@+id/btn_spam_img"
android:layout_toLeftOf="@+id/btn_spam_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
</TableRow>
</TableLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment