Skip to content

Instantly share code, notes, and snippets.

@mdavalos1993
Last active August 5, 2019 19:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdavalos1993/50152d74f9c783e6763c67901068c98f to your computer and use it in GitHub Desktop.
Save mdavalos1993/50152d74f9c783e6763c67901068c98f to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.cardview.widget.CardView
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginBottom="6dp"
android:foreground="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary">
<View
android:id="@+id/bg"
android:layout_width="match_parent"
android:background="@color/md_white_1000"
android:layout_height="150dp"
android:layout_marginBottom="8dp"/>
<ImageButton
android:id="@+id/btn_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="6dp"
android:background="?android:attr/selectableItemBackground"
android:src="@drawable/ic_more_vert_grey_24dp"
android:layout_alignParentEnd="true" />
<ImageView
android:id="@+id/img_book"
android:layout_margin="16dp"
android:layout_width="105dp"
android:layout_height="160dp"
android:background="@drawable/bg_image_book" />
<TextView
android:id="@+id/lbl_name"
android:layout_width="match_parent"
android:layout_marginRight="8dp"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:layout_toRightOf="@id/img_book"
android:layout_toLeftOf="@id/btn_more"
android:layout_alignTop="@id/img_book"
android:textSize="@dimen/text_xxx_large"
android:ellipsize="end"
android:lines="4"
android:layout_toEndOf="@id/img_book"
android:layout_marginEnd="8dp"
android:layout_toStartOf="@id/btn_more" />
<TextView
android:id="@+id/lbl_year"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAlignment="center"
android:textColor="@color/md_white_1000"
android:padding="4dp"
android:layout_centerVertical="true"
android:layout_below="@id/bg"
android:text="@string/year"
android:textSize="@dimen/text_small"
android:layout_marginRight="8dp"
android:textAllCaps="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginEnd="8dp" />
<TextView
android:id="@+id/lbl_language"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/language"
android:layout_toLeftOf="@id/lbl_year"
android:layout_below="@id/bg"
android:layout_marginRight="4dp"
android:textColor="@color/md_white_1000"
android:padding="4dp"
android:textAllCaps="true"
android:textSize="@dimen/text_small"
android:layout_toStartOf="@id/lbl_year"
android:layout_marginEnd="4dp" />
<TextView
android:id="@+id/lbl_category"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/category"
android:textColor="@color/md_white_1000"
android:textAllCaps="true"
android:textSize="@dimen/text_small"
android:layout_toLeftOf="@id/lbl_language"
android:layout_toStartOf="@id/lbl_language"
android:layout_below="@id/bg"
android:padding="4dp"
android:layout_marginRight="4dp"
android:layout_marginEnd="4dp" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
</RelativeLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment