<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView android:id="@+id/download_card_view"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:backgroundTint="@android:color/transparent"
    android:checkable="true"
    android:clickable="true"
    android:focusable="true"
    app:checkedIcon="@null"
    app:strokeColor="?attr/colorPrimary"
    app:cardPreventCornerOverlap="true"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:shapeAppearance="@style/ShapeAppearanceOverlay.Avatar"
    app:strokeWidth="0dp"
    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">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:paddingVertical="10dp"
        android:paddingHorizontal="20dp"
        android:layout_height="wrap_content">

        <androidx.appcompat.widget.AppCompatImageView
            android:id="@+id/drag_view"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="end|center_vertical"
            android:clickable="false"
            android:visibility="gone"
            android:focusable="false"
            android:paddingVertical="16dp"
            android:paddingEnd="20dp"
            android:paddingStart="0dp"
            android:tintMode="src_in"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:srcCompat="@drawable/ic_drag_handle"
            app:tint="?attr/colorControlNormal"
            tools:ignore="ContentDescription" />

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/card_content"
            android:layout_width="0dp"
            android:clickable="true"
            android:focusable="true"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintStart_toEndOf="@id/drag_view"
            app:layout_constraintEnd_toEndOf="parent"
            android:layout_height="wrap_content">

                <com.google.android.material.imageview.ShapeableImageView
                    android:id="@+id/downloads_image_view"
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:adjustViewBounds="true"
                    android:background="?attr/colorSurfaceVariant"
                    android:scaleType="centerCrop"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintDimensionRatio="H,16:9"
                    app:layout_constraintEnd_toStartOf="@+id/download_item_data"
                    app:layout_constraintHorizontal_weight="0.3"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    app:shapeAppearance="@style/ShapeAppearanceOverlay.Avatar" />


                <TextView
                    android:id="@+id/duration"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_margin="5dp"
                    android:background="#80000000"
                    android:clickable="false"
                    android:ellipsize="end"
                    android:gravity="center"
                    android:maxLength="17"
                    android:maxLines="1"
                    android:minWidth="30dp"
                    android:paddingHorizontal="5dp"
                    android:textColor="@color/white"
                    android:textSize="12sp"
                    android:textStyle="bold"
                    app:cornerRadius="10dp"
                    app:layout_constraintBottom_toBottomOf="@+id/downloads_image_view"
                    app:layout_constraintEnd_toEndOf="@+id/downloads_image_view" />

                <androidx.constraintlayout.widget.ConstraintLayout
                    android:id="@+id/download_item_data"
                    android:layout_width="0dp"
                    android:clickable="false"
                    android:focusable="false"
                    android:layout_height="wrap_content"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintHorizontal_weight="0.7"
                    app:layout_constraintStart_toEndOf="@+id/downloads_image_view"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintVertical_bias="0.0">

                    <TextView
                        android:id="@+id/title"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:ellipsize="end"
                        android:maxLines="2"
                        android:paddingHorizontal="5dp"
                        android:scrollbars="none"
                        android:textSize="15sp"
                        android:textStyle="bold"
                        app:layout_constraintEnd_toStartOf="@+id/options"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toTopOf="parent" />

                    <androidx.constraintlayout.widget.Barrier
                        android:id="@+id/barrier"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        app:barrierDirection="bottom"
                        app:constraint_referenced_ids="title,options" />

                    <HorizontalScrollView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:gravity="bottom"
                        android:paddingStart="5dp"
                        android:paddingEnd="0dp"
                        android:scrollbars="none"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintHorizontal_bias="0.0"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toBottomOf="@+id/barrier">

                        <LinearLayout
                            android:layout_width="wrap_content"
                            android:layout_height="match_parent">

                            <TextView
                                android:id="@+id/download_type"
                                style="@style/Widget.Material3.FloatingActionButton.Large.Secondary"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginEnd="5dp"
                                android:background="@drawable/rounded_corner"
                                android:backgroundTint="?attr/colorSecondary"
                                android:clickable="false"
                                android:gravity="center"
                                android:minWidth="30dp"
                                android:paddingHorizontal="5dp"
                                android:textSize="12sp"
                                android:textStyle="bold"
                                app:cornerRadius="10dp"
                                app:layout_constraintBottom_toBottomOf="parent"
                                app:layout_constraintStart_toStartOf="parent"
                                app:layout_constraintTop_toTopOf="parent"/>

                            <TextView
                                android:id="@+id/file_size"
                                style="@style/Widget.Material3.FloatingActionButton.Large.Secondary"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginEnd="5dp"
                                android:background="@drawable/rounded_corner"
                                android:backgroundTint="?attr/colorSecondary"
                                android:clickable="false"
                                android:gravity="center"
                                android:minWidth="30dp"
                                android:paddingHorizontal="5dp"
                                android:textSize="12sp"
                                android:textStyle="bold"
                                app:cornerRadius="10dp"
                                app:layout_constraintBottom_toBottomOf="parent"
                                app:layout_constraintStart_toStartOf="parent"
                                app:layout_constraintTop_toTopOf="parent" />

                            <TextView
                                android:id="@+id/format_note"
                                style="@style/Widget.Material3.FloatingActionButton.Large.Secondary"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginEnd="5dp"
                                android:background="@drawable/rounded_corner"
                                android:backgroundTint="?attr/colorSecondary"
                                android:clickable="false"
                                android:ellipsize="end"
                                android:gravity="center"
                                android:maxLength="17"
                                android:maxLines="1"
                                android:minWidth="30dp"
                                android:paddingHorizontal="5dp"
                                android:textSize="12sp"
                                android:textStyle="bold"
                                app:cornerRadius="10dp"
                                app:layout_constraintBottom_toBottomOf="parent"
                                app:layout_constraintStart_toStartOf="parent"
                                app:layout_constraintTop_toTopOf="parent" />

                            <TextView
                                android:id="@+id/codec"
                                style="@style/Widget.Material3.FloatingActionButton.Large.Secondary"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginEnd="5dp"
                                android:background="@drawable/rounded_corner"
                                android:backgroundTint="?attr/colorSecondary"
                                android:clickable="false"
                                android:gravity="center"
                                android:minWidth="30dp"
                                android:paddingHorizontal="5dp"
                                android:textSize="12sp"
                                android:textStyle="bold"
                                app:cornerRadius="10dp"
                                app:layout_constraintBottom_toBottomOf="parent"
                                app:layout_constraintStart_toStartOf="parent"
                                app:layout_constraintTop_toTopOf="parent" />




                        </LinearLayout>


                    </HorizontalScrollView>

                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/options"
                        style="?attr/materialIconButtonStyle"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:minHeight="0dp"
                        android:clickable="true"
                        android:focusable="true"
                        android:padding="0dp"
                        app:cornerRadius="10dp"
                        app:icon="@drawable/baseline_more_vert_24"
                        app:iconTint="?attr/colorAccent"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintTop_toTopOf="parent"
                        app:layout_constraintVertical_bias="0.0" />

            </androidx.constraintlayout.widget.ConstraintLayout>


        </androidx.constraintlayout.widget.ConstraintLayout>


    </androidx.constraintlayout.widget.ConstraintLayout>

</com.google.android.material.card.MaterialCardView>
