<?xml version="1.0" encoding="utf-8"?>
<layout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <data>
        <import type="android.view.View"/>
        <variable
            name="posts"
            type="com.visticsolution.posterbanao.model.PostsModel" />
    </data>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/_4sdp"
        android:layoutAnimation="@anim/rc_animation">

        <androidx.cardview.widget.CardView
            android:id="@+id/cv_base"
            android:layout_width="90dp"
            android:layout_height="90dp"
            app:cardBackgroundColor="@color/transparent"
            app:cardCornerRadius="@dimen/_4sdp"
            app:cardElevation="0dp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <androidx.cardview.widget.CardView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_margin="2dp"
                app:cardCornerRadius="4dp"
                app:cardElevation="0dp"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent">

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_gravity="center">

                    <ImageView
                        android:id="@+id/video_thumbnail"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:scaleType="centerCrop"
                        android:imageURL="@{posts.thumb_url}"
                        android:src="@drawable/placeholder" />

                </RelativeLayout>
                <RelativeLayout
                    android:layout_margin="@dimen/_5sdp"
                    android:id="@+id/premium_tag"
                    android:layout_gravity="right"
                    android:layout_width="@dimen/_25sdp"
                    android:layout_height="@dimen/_25sdp"
                    android:isPremium="@{posts.premium}">

                    <ImageView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_centerInParent="true"
                        android:src="@drawable/ic_crown"/>

                </RelativeLayout>

                <TextView
                    android:visibility="gone"
                    android:id="@+id/isTamplate"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/tamplate"
                    android:layout_gravity="bottom|right"
                    android:background="@drawable/rounded_bg"
                    android:textStyle="bold"
                    android:textColor="@color/white"
                    android:textSize="@dimen/_10sdp"
                    android:paddingVertical="@dimen/_2sdp"
                    android:paddingHorizontal="@dimen/_5sdp"
                    android:layout_margin="@dimen/_5sdp"/>
                <ImageView
                    android:id="@+id/video_type"
                    android:layout_margin="@dimen/_5sdp"
                    android:layout_width="@dimen/_20sdp"
                    android:layout_height="@dimen/_20sdp"
                    android:padding="@dimen/_3sdp"
                    android:src="@drawable/exo_controls_play"
                    android:background="@drawable/rounded_bg"
                    android:layout_gravity="bottom"
                    android:isVideo="@{posts.item_url}"/>

            </androidx.cardview.widget.CardView>

        </androidx.cardview.widget.CardView>
    </androidx.constraintlayout.widget.ConstraintLayout>

</layout>
