<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="115dp"
    android:orientation="vertical">

    <LinearLayout
        android:id="@+id/item_video"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:layout_marginTop="5dp"
        android:layout_marginBottom="5dp">
        <FrameLayout
            android:id="@+id/player_container"
            android:layout_width="178dp"
            android:layout_height="100dp">

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

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

                <LinearLayout
                    android:id="@+id/thumbnail_live_container"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentBottom="true"
                    android:layout_alignParentEnd="true"
                    android:layout_gravity="end"
                    android:paddingStart="2dp"
                    android:paddingEnd="2dp"
                    android:layout_marginEnd="4dp"
                    android:layout_marginBottom="4dp"
                    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_alignParentBottom="true"
                    android:layout_alignParentEnd="true"
                    android:layout_gravity="end"
                    android:paddingStart="2dp"
                    android:paddingEnd="2dp"
                    android:layout_marginEnd="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/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>

                <FrameLayout android:id="@+id/layout_downloaded"
                    android:layout_width="16dp"
                    android:layout_height="16dp"
                    android:layout_alignParentEnd="true"
                    android:layout_alignParentTop="true"
                    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:contentDescription="@string/cd_download_indicator"
                        android:scaleType="fitXY"
                        app:srcCompat="@drawable/download_for_offline" />
                </FrameLayout>

                <com.futo.platformplayer.views.platform.PlatformIndicator
                    android:id="@+id/thumbnail_platform"
                    android:layout_width="20dp"
                    android:layout_height="20dp"
                    android:contentDescription="@string/cd_platform_indicator"
                    android:layout_alignParentStart="true"
                    android:layout_alignParentBottom="true"
                    android:layout_gravity="end"
                    android:layout_marginStart="4dp"
                    android:layout_marginBottom="4dp" />

                <com.futo.platformplayer.views.others.ProgressBar
                    android:id="@+id/time_bar"
                    android:layout_width="match_parent"
                    android:layout_height="2dp"
                    android:layout_alignParentStart="true"
                    android:layout_alignParentBottom="true"
                    app:progress="60%"
                    app:inactiveColor="#55EEEEEE"
                    app:radiusBottomLeft="4dp"
                    app:radiusBottomRight="4dp"
                    app:radiusTopLeft="0dp"
                    app:radiusTopRight="0dp"
                    android:visibility="visible"/>
            </RelativeLayout>
        </FrameLayout>

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginStart="6dp"
            android:layout_marginEnd="6dp">

            <LinearLayout
                android:id="@+id/button_add_to"
                android:layout_width="wrap_content"
                android:layout_height="27dp"
                android:orientation="horizontal"
                android:background="@drawable/edit_text_background"
                android:gravity="center_vertical"
                android:padding="5dp"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintBottom_toBottomOf="parent">
                <ImageView
                    android:layout_width="20dp"
                    android:layout_height="16dp"
                    android:paddingTop="1dp"
                    android:src="@drawable/ic_settings" />

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


            <ImageButton
                android:id="@+id/button_add_to_queue"
                android:layout_width="wrap_content"
                android:layout_height="27dp"
                android:src="@drawable/ic_queue"
                android:paddingTop="4dp"
                android:paddingBottom="2dp"
                android:paddingLeft="10dp"
                android:paddingRight="7dp"
                android:layout_marginLeft="5dp"
                android:scaleType="fitCenter"
                android:background="@drawable/edit_text_background"
                android:contentDescription="@string/add_to_queue"
                app:layout_constraintLeft_toRightOf="@id/button_add_to"
                app:layout_constraintBottom_toBottomOf="parent" />

            <ImageButton
                android:id="@+id/button_add_to_watch_later"
                android:layout_width="wrap_content"
                android:layout_height="27dp"
                android:contentDescription="@string/cd_button_add_to_watch_later"
                android:src="@drawable/ic_clock_white"
                android:paddingTop="7dp"
                android:paddingBottom="6dp"
                android:paddingLeft="9dp"
                android:paddingRight="9dp"
                android:layout_marginLeft="5dp"
                android:scaleType="fitCenter"
                android:background="@drawable/edit_text_background"
                app:layout_constraintLeft_toRightOf="@id/button_add_to_queue"
                app:layout_constraintBottom_toBottomOf="parent" />

            <TextView
                android:id="@+id/text_video_name"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:paddingBottom="2dp"
                android:layout_weight="1"
                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 fff"
                android:maxLines="2"
                android:ellipsize="end"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                app:layout_constraintRight_toRightOf="parent" />

            <ImageView
                android:id="@+id/image_channel_thumbnail"
                android:layout_width="28dp"
                android:layout_height="28dp"
                android:background="@drawable/rounded_outline"
                android:contentDescription="@string/channel_image"
                tools:src="@drawable/placeholder_channel_thumbnail"
                android:clipToOutline="true"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintTop_toBottomOf="@id/text_video_name" />

            <TextView
                android:id="@+id/text_channel_name"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:gravity="center_vertical"
                android:maxLines="1"
                android:ellipsize="end"
                android:textSize="10dp"
                android:textColor="@color/gray_e0"
                android:fontFamily="@font/inter_extra_light"
                tools:text="Two Minute Papers"
                app:layout_constrainedWidth="true"
                app:layout_constraintHorizontal_bias="0"
                app:layout_constraintHorizontal_chainStyle="packed"
                app:layout_constraintLeft_toRightOf="@id/image_channel_thumbnail"
                app:layout_constraintRight_toRightOf="parent"
                app:layout_constraintTop_toBottomOf="@id/text_video_name"
                android:layout_marginStart="4dp" />

            <TextView
                android:id="@+id/text_video_metadata"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:maxLines="1"
                android:gravity="center_vertical"
                android:textSize="10dp"
                android:textColor="@color/gray_e0"
                android:fontFamily="@font/inter_extra_light"
                tools:text="57K views • 1 day ago"
                app:layout_constraintLeft_toRightOf="@id/image_channel_thumbnail"
                app:layout_constraintTop_toBottomOf="@id/text_channel_name"
                app:layout_constraintRight_toRightOf="parent"
                android:layout_marginStart="4dp"/>

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


</LinearLayout>