Skip to content

Instantly share code, notes, and snippets.

@shubhamnikam
Created January 24, 2019 18:14
Show Gist options
  • Save shubhamnikam/03bea85f19c574fa61a7d952492e5995 to your computer and use it in GitHub Desktop.
Save shubhamnikam/03bea85f19c574fa61a7d952492e5995 to your computer and use it in GitHub Desktop.
shimmer book_list_item
<?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:background="@android:color/white"
android:clickable="true"
android:focusable="true"
android:foreground="?attr/selectableItemBackground"
android:padding="@dimen/activity_padding_horizontal">
<ImageView
android:id="@+id/thumbnail"
android:layout_width="@dimen/placeholder_image"
android:layout_height="@dimen/placeholder_image"
android:layout_marginRight="@dimen/padding_10"
android:scaleType="centerCrop" />
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/thumbnail"
android:ellipsize="end"
android:fontFamily="sans-serif-medium"
android:maxLines="1"
android:textColor="@color/item_name"
android:textSize="@dimen/name" />
<TextView
android:id="@+id/author"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/name"
android:layout_toRightOf="@id/thumbnail"
android:maxLines="1"
android:textColor="@color/author"
android:textSize="@dimen/author" />
<TextView
android:id="@+id/release"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/author"
android:layout_toRightOf="@id/thumbnail"
android:maxLines="1"
android:text=""
android:textColor="@color/release"
android:textSize="@dimen/release" />
<TextView
android:id="@+id/description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/thumbnail"
android:layout_marginTop="@dimen/activity_padding_horizontal"
android:ellipsize="end"
android:maxLines="3"
android:textColor="@color/description"
android:textSize="@dimen/description" />
<TextView
android:id="@+id/price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/description"
android:layout_alignParentEnd="true"
android:layout_marginTop="10dp"
android:layout_marginEnd="24dp"
android:textColor="@color/colorPrimary"
android:textSize="@dimen/price"
android:textStyle="bold" />
</RelativeLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment