Skip to content

Instantly share code, notes, and snippets.

@valokafor
Created September 18, 2014 21:35
Show Gist options
  • Save valokafor/b7e2d6f307973f82bd31 to your computer and use it in GitHub Desktop.
Save valokafor/b7e2d6f307973f82bd31 to your computer and use it in GitHub Desktop.
Example of Android Custom List Row
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="5dp"
android:paddingBottom="5dp">
<RelativeLayout android:id="@+id/rlyTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:layout_alignParentLeft="true">
<ImageView android:id="@+id/imgProviderLogo"
android:layout_width="50dp"
android:layout_height="30dp"
android:scaleType="fitXY"
android:layout_centerVertical="true"
android:background="@drawable/img_ae"
android:layout_marginRight="5dp"/>
<TextView android:id="@+id/txtBillName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/black"
android:textSize="16sp"
android:text="Bill Name"
android:layout_toEndOf="@+id/imgProviderLogo"
android:layout_alignTop="@+id/imgProviderLogo"
android:layout_toRightOf="@+id/imgProviderLogo"/>
<TextView android:id="@+id/txtDue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/bg_header"
android:textSize="14sp"
android:text="@string/lbl_due"
android:layout_below="@+id/txtBillName"
android:layout_alignLeft="@+id/txtBillName"
android:layout_alignStart="@+id/txtBillName"/>
<TextView android:id="@+id/txtNumberOfDay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/bg_header"
android:textSize="14sp"
android:text="4"
android:layout_below="@+id/txtBillName"
android:layout_marginLeft="5dp"
android:layout_toRightOf="@+id/txtDue"
android:layout_toEndOf="@+id/txtDue"/>
<TextView android:id="@+id/txtDay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/bg_header"
android:textSize="14sp"
android:text="@string/lbl_day"
android:layout_below="@+id/txtBillName"
android:layout_marginLeft="5dp"
android:layout_toRightOf="@+id/txtNumberOfDay"/>
<TextView android:id="@+id/txtAmount"
android:layout_below="@+id/txtBillName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:textColor="@color/fg_login_instruction"
android:textSize="12sp"
android:text="100.00"/>
</RelativeLayout>
</RelativeLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment