<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (c) 2018.
  ~
  ~ This file is part of MovieDB.
  ~
  ~ MovieDB is free software: you can redistribute it and/or modify
  ~ it under the terms of the GNU General Public License as published by
  ~ the Free Software Foundation, either version 3 of the License, or
  ~ (at your option) any later version.
  ~
  ~ MovieDB is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ~ GNU General Public License for more details.
  ~
  ~ You should have received a copy of the GNU General Public License
  ~ along with MovieDB.  If not, see <http://www.gnu.org/licenses/>.
  -->

<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:card_view="http://schemas.android.com/apk/res-auto"
    android:id="@+id/cardView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    card_view:cardCornerRadius="3dip"
    card_view:cardElevation="0.5dip"
    card_view:cardUseCompatPadding="true">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="150dip"
        android:gravity="center_horizontal"
        android:padding="6dip">

        <ImageView
            android:id="@+id/image"
            android:layout_width="100dp"
            android:layout_height="150dip"
            android:adjustViewBounds="true"
            android:contentDescription="@string/image_description"
            android:scaleType="fitXY" />

        <View
            android:layout_width="6dp"
            android:layout_height="wrap_content" />

        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">

            <TextView
                android:id="@+id/title"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true"
                android:layout_alignParentTop="true"
                android:layout_marginBottom="8dip"
                android:ellipsize="end"
                android:maxLines="1"
                android:textSize="20sp"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/description"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true"
                android:layout_alignWithParentIfMissing="true"
                android:layout_below="@id/title"
                android:layout_marginBottom="5dip"
                android:ellipsize="end"
                android:maxLines="3" />

            <TextView
                android:id="@+id/genre"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true"
                android:layout_alignWithParentIfMissing="true"
                android:layout_below="@id/description"
                android:layout_marginBottom="5dip"
                android:ellipsize="end"
                android:maxLines="1" />

            <RatingBar
                android:id="@+id/rating"
                style="?android:attr/ratingBarStyleSmall"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/genre"
                android:layout_marginBottom="5dip"
                android:numStars="5"
                android:rating="3.5" />

            <TextView
                android:id="@+id/date"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true"
                android:textStyle="italic"
                android:textSize="10sp"/>

        </RelativeLayout>

    </LinearLayout>

    <View
        android:id="@+id/categoryColor"
        android:layout_width="5dip"
        android:layout_height="match_parent"
        android:layout_gravity="end"
        android:background="@color/colorGreen"
        android:visibility="gone" />

</android.support.v7.widget.CardView>

