<?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">

    <FrameLayout
        android:id="@+id/layout_video_thumbnail"
        android:layout_width="120dp"
        android:layout_height="86dp"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintBottom_toBottomOf="parent">

        <com.google.android.material.imageview.ShapeableImageView
            android:id="@+id/downloaded_video_image"
            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" />

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

            <TextView
                android:id="@+id/downloaded_video_size"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:includeFontPadding="false"
                android:paddingLeft="2dp"
                android:paddingRight="2dp"
                android:textColor="#FFFFFF"
                android:textSize="10dp"
                tools:text="\?"
                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/downloaded_video_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="10dp"
                tools:text="0:00"
                android:layout_gravity="center"
                android:textStyle="normal" />
        </LinearLayout>

        <com.futo.platformplayer.views.platform.PlatformIndicator
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom|start"
            android:layout_marginStart="4dp"
            android:layout_marginBottom="4dp" />
    </FrameLayout>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/layout_text_container"
        android:orientation="vertical"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toRightOf="@id/layout_video_thumbnail">

        <TextView
            android:id="@+id/downloaded_video_name"
            android:layout_height="wrap_content"
            android:layout_width="0dp"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintRight_toRightOf="parent"

            android:gravity="center_vertical"
            android:textSize="11dp"
            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="2"
            android:ellipsize="end"
            android:layout_marginStart="10dp"
            android:layout_marginEnd="10dp" />

        <TextView
            android:id="@+id/downloaded_author"
            android:layout_height="wrap_content"
            android:layout_width="0dp"
            android:gravity="center_vertical"
            android:textSize="9dp"
            android:textColor="@color/gray_e0"
            android:fontFamily="@font/inter_extra_light"
            tools:text="ShortCircuit"
            android:maxLines="1"
            android:ellipsize="end"
            app:layout_constraintTop_toBottomOf="@id/downloaded_video_name"
            app:layout_constraintLeft_toLeftOf="@id/downloaded_video_name"
            app:layout_constraintRight_toRightOf="@id/downloaded_video_name" />

        <TextView
            android:id="@+id/downloaded_video_info"
            android:layout_height="wrap_content"
            android:layout_width="0dp"
            app:layout_constraintTop_toBottomOf="@id/downloaded_author"
            app:layout_constraintLeft_toLeftOf="@id/downloaded_video_name"
            app:layout_constraintRight_toRightOf="@id/downloaded_video_name"
            android:textSize="10dp"
            android:textColor="@color/gray_e0"
            android:fontFamily="@font/inter_extra_light"
            tools:text="720P (video/mp4) • 152kbps (audio/mp4)"
            android:maxLines="1"
            android:ellipsize="end"
            android:layout_marginBottom="2dp" />

        <ImageButton
            android:id="@+id/button_add_to_queue"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="1dp"
            android:paddingTop="7dp"
            android:paddingStart="6dp"
            android:paddingEnd="5dp"
            android:paddingBottom="3dp"
            app:srcCompat="@drawable/ic_queue_16dp"
            android:background="@drawable/edit_text_background"
            android:contentDescription="@string/add_to_queue"
            app:layout_constraintLeft_toLeftOf="@id/downloaded_video_name"
            app:layout_constraintBottom_toBottomOf="parent" />

        <LinearLayout
            android:id="@+id/button_export"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:background="@drawable/edit_text_background"
            android:layout_marginStart="4dp"
            android:gravity="center_vertical"
            android:padding="4dp"
            app:layout_constraintLeft_toRightOf="@id/button_add_to_queue"
            app:layout_constraintBottom_toBottomOf="parent">
            <ImageButton
                android:layout_width="18dp"
                android:layout_height="18dp"
                android:scaleType="fitCenter"
                android:layout_marginEnd="4dp"
                app:srcCompat="@drawable/ic_export"
                android:layout_marginStart="4dp"
                android:contentDescription="@string/export" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/export"
                android:background="@color/transparent"
                android:textSize="12dp"
                android:textColor="@color/white"
                android:fontFamily="@font/inter_light"
                android:layout_marginEnd="4dp"/>
        </LinearLayout>

        <LinearLayout
            android:id="@+id/downloaded_video_delete"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:background="@drawable/edit_text_background"
            android:layout_marginStart="4dp"
            android:gravity="center_vertical"
            android:padding="4dp"
            app:layout_constraintLeft_toRightOf="@id/button_export"
            app:layout_constraintBottom_toBottomOf="parent">
            <ImageButton
                android:layout_width="18dp"
                android:layout_height="18dp"
                android:scaleType="fitCenter"
                android:layout_marginEnd="4dp"
                app:srcCompat="@drawable/ic_trash"
                android:layout_marginStart="4dp"
                android:contentDescription="@string/delete" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/delete"
                android:background="@color/transparent"
                android:textSize="12dp"
                android:textColor="@color/white"
                android:fontFamily="@font/inter_light"
                android:layout_marginEnd="4dp"/>
        </LinearLayout>
    </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>