<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:layout_marginTop="5dp"
    android:layout_marginBottom="5dp"
    android:id="@+id/root"
    android:clickable="true">

    <ImageButton
        android:id="@+id/image_drag_drop"
        android:layout_width="40dp"
        android:layout_height="40dp"
        android:contentDescription="@string/cd_drag_drop"
        app:srcCompat="@drawable/ic_dragdrop_white"
        android:scaleType="fitCenter"
        android:paddingTop="10dp"
        android:paddingBottom="10dp"
        android:paddingStart="12dp"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintTop_toTopOf="@id/layout_video_thumbnail"
        app:layout_constraintBottom_toBottomOf="@id/layout_video_thumbnail" />

    <FrameLayout
        android:id="@+id/layout_video_thumbnail"
        android:layout_width="0dp"
        android:layout_height="100dp"
        app:layout_constraintLeft_toRightOf="@id/image_drag_drop"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintDimensionRatio="W,1.7:1"
        android:layout_marginStart="12dp">

        <com.google.android.material.imageview.ShapeableImageView
            android:id="@+id/image_video_thumbnail"
            android:layout_height="match_parent"
            android:layout_width="match_parent"
            android:scaleType="centerCrop"
            app:shapeAppearanceOverlay="@style/roundedCorners_4dp"
            app:srcCompat="@drawable/placeholder_video_thumbnail"
            android:background="@drawable/video_thumbnail_outline" />

        <com.futo.platformplayer.views.others.ProgressBar
            android:id="@+id/time_bar"
            android:layout_width="match_parent"
            android:layout_height="2dp"
            android:layout_gravity="bottom"
            app:progress="60%"
            app:inactiveColor="#55EEEEEE"
            android:layout_marginBottom="0dp"
            app:radiusBottomLeft="4dp"
            app:radiusBottomRight="4dp"
            app:radiusTopLeft="0dp"
            app:radiusTopRight="0dp" />

        <LinearLayout
            android:id="@+id/thumbnail_live_container"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom|end"
            android:paddingStart="2dp"
            android:paddingEnd="2dp"
            android:layout_marginEnd="4dp"
            android:layout_marginBottom="6dp"
            android:paddingTop="0dp"
            android:gravity="center_vertical"
            android:orientation="horizontal"
            android:background="@drawable/background_thumbnail_live">

            <TextView
                android:id="@+id/thumbnail_live"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:includeFontPadding="false"
                android:paddingLeft="2dp"
                android:paddingRight="2dp"
                android:textColor="#FFFFFF"
                android:textSize="12dp"
                android:text="@string/live"
                android:layout_gravity="center"
                android:textStyle="normal" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/thumbnail_duration_container"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom|end"
            android:paddingStart="2dp"
            android:paddingEnd="2dp"
            android:layout_marginEnd="4dp"
            android:layout_marginBottom="6dp"
            android:paddingTop="0dp"
            android:gravity="center_vertical"
            android:orientation="horizontal"
            android:background="@drawable/background_thumbnail_duration">

            <TextView
                android:id="@+id/thumbnail_duration"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:includeFontPadding="false"
                android:paddingLeft="2dp"
                android:paddingRight="2dp"
                android:textColor="#FFFFFF"
                android:textSize="12dp"
                tools:text="0:00"
                android:layout_gravity="center"
                android:textStyle="normal" />
        </LinearLayout>

        <com.futo.platformplayer.views.platform.PlatformIndicator
            android:id="@+id/thumbnail_platform"
            android:layout_width="20dp"
            android:layout_height="20dp"
            android:layout_gravity="bottom|start"
            android:layout_marginStart="4dp"
            android:layout_marginBottom="6dp" />

        <FrameLayout android:id="@+id/layout_downloaded"
            android:layout_width="16dp"
            android:layout_height="16dp"
            android:layout_gravity="top|end"
            android:background="@drawable/background_pill_black"
            android:layout_marginTop="2dp"
            android:layout_marginEnd="2dp">

            <ImageView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:scaleType="fitXY"
                android:contentDescription="@string/cd_download_indicator"
                app:srcCompat="@drawable/download_for_offline" />
        </FrameLayout>
    </FrameLayout>

    <TextView
        android:id="@+id/text_video_name"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:gravity="center_vertical"
        android:textSize="13dp"
        android:textColor="@color/white"
        android:fontFamily="@font/inter_light"
        tools:text="Legendary grant recipient: Marvin Wißfeld of MicroG Very loong title with a lot of words"
        android:maxLines="3"
        android:ellipsize="end"
        app:layout_constraintLeft_toRightOf="@id/layout_video_thumbnail"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintRight_toLeftOf="@id/buttons"
        app:layout_constraintBottom_toTopOf="@id/text_author"
        android:layout_marginStart="10dp" />

    <TextView
        android:id="@+id/text_author"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:gravity="center_vertical"
        android:textSize="10dp"
        android:textColor="@color/gray_e0"
        android:fontFamily="@font/inter_extra_light"
        tools:text="ShortCircuit"
        android:maxLines="1"
        android:ellipsize="end"
        app:layout_constraintLeft_toRightOf="@id/layout_video_thumbnail"
        app:layout_constraintTop_toBottomOf="@id/text_video_name"
        app:layout_constraintRight_toLeftOf="@id/buttons"
        app:layout_constraintBottom_toTopOf="@id/text_video_metadata"
        android:layout_marginStart="10dp"  />

    <TextView
        android:id="@+id/text_video_metadata"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:gravity="center_vertical"
        android:textSize="10dp"
        android:textColor="@color/gray_e0"
        android:fontFamily="@font/inter_extra_light"
        tools:text="369 views • 1 months ago"
        android:maxLines="1"
        android:ellipsize="end"
        app:layout_constraintLeft_toRightOf="@id/layout_video_thumbnail"
        app:layout_constraintTop_toBottomOf="@id/text_author"
        app:layout_constraintRight_toLeftOf="@id/buttons"
        android:layout_marginStart="10dp" />

    <LinearLayout
        android:id="@+id/buttons"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="@id/layout_video_thumbnail"
        app:layout_constraintBottom_toBottomOf="@id/layout_video_thumbnail" >
        <ImageButton
            android:id="@+id/image_trash"
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:contentDescription="@string/cd_button_delete"
            app:srcCompat="@drawable/ic_trash_18dp"
            android:scaleType="fitCenter"
            android:paddingTop="10dp"
            android:paddingBottom="10dp"/>
        <ImageButton
            android:id="@+id/image_settings"
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:contentDescription="@string/cd_button_settings"
            app:srcCompat="@drawable/ic_settings"
            android:scaleType="fitCenter"
            android:paddingTop="10dp"
            android:paddingBottom="10dp"  />

    </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>