<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    xmlns:android="http://schemas.android.com/apk/res/android">

    <RelativeLayout
        android:layout_width="0dp"
        android:layout_marginHorizontal="10dp"
        android:layout_height="0dp"
        app:layout_constraintDimensionRatio="H,2:1"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <com.google.android.material.card.MaterialCardView
            android:id="@+id/active_download_card_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:cardCornerRadius="20dp"
            app:cardElevation="5dp"
            android:checkable="true"
            app:strokeWidth="0dp"
            app:cardPreventCornerOverlap="true"
            android:layout_margin="10dp">

            <androidx.appcompat.widget.AppCompatImageView
                android:id="@+id/image_view"
                android:adjustViewBounds="true"
                android:scaleType="centerCrop"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />

                <com.google.android.material.progressindicator.LinearProgressIndicator
                    android:id="@+id/progress"
                    android:layout_width="match_parent"
                    app:trackColor="#000"
                    android:layout_height="match_parent"
                    android:layout_gravity="bottom"
                    android:alpha="0.3"
                    android:scaleY="200"/>

            <androidx.constraintlayout.widget.ConstraintLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent">

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/download_type"
                    style="?attr/materialIconButtonFilledTonalStyle"
                    android:layout_width="24dp"
                    android:layout_height="24dp"
                    android:layout_margin="10dp"
                    android:insetLeft="0dp"
                    android:insetTop="0dp"
                    android:insetRight="0dp"
                    android:insetBottom="0dp"
                    app:backgroundTint="?attr/colorSurface"
                    app:icon="@drawable/ic_music"
                    app:iconGravity="textStart"
                    app:iconPadding="0dp"
                    android:contentDescription="@string/preferred_download_type"
                    app:iconSize="11dp"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    app:shapeAppearanceOverlay="@style/ShapeAppearance.Material3.Corner.Full" />

                <HorizontalScrollView
                    android:id="@+id/linearlayout2_horizontalscrollview"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="10dp"
                    android:layout_marginTop="10dp"
                    android:scrollbars="none"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintHorizontal_bias="0.0"
                    app:layout_constraintStart_toEndOf="@+id/download_type"
                    app:layout_constraintTop_toTopOf="parent">

                    <com.google.android.material.chip.ChipGroup
                        android:layout_width="24dp"
                        android:layout_height="24dp"
                        android:layout_gravity="center_vertical|end"
                        android:orientation="horizontal"
                        android:paddingHorizontal="10dp"
                        app:chipSpacingHorizontal="0dp">

                        <com.google.android.material.chip.Chip
                            android:id="@+id/format_note"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:clickable="false"
                            android:textSize="11sp"
                            app:chipBackgroundColor="?attr/colorSurface"
                            app:chipMinTouchTargetSize="0dp"
                            app:chipStrokeWidth="0.5dp"
                            app:layout_constraintBottom_toBottomOf="parent"
                            app:layout_constraintStart_toStartOf="parent"
                            app:layout_constraintTop_toTopOf="parent"
                            app:shapeAppearance="@style/ShapeAppearanceOverlay.Chip.Rounded" />

                    </com.google.android.material.chip.ChipGroup>

                </HorizontalScrollView>

                <LinearLayout
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:dividerPadding="5dp"
                    android:orientation="vertical"
                    app:layout_constraintBottom_toTopOf="@+id/output"
                    app:layout_constraintEnd_toStartOf="@+id/active_pause_cancel_btns"
                    app:layout_constraintHorizontal_bias="0.0"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/linearlayout2_horizontalscrollview">

                    <TextView
                        android:id="@+id/title"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:ellipsize="end"
                        android:maxLines="1"
                        android:paddingStart="10dp"
                        android:paddingTop="10dp"
                        android:paddingEnd="10dp"
                        android:shadowColor="@color/black"
                        android:shadowDx="2"
                        android:shadowDy="2"
                        android:shadowRadius="1"
                        android:textColor="#FFF"
                        android:textSize="17sp"
                        android:textStyle="bold" />

                    <TextView
                        android:id="@+id/author"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:ellipsize="end"
                        android:gravity="bottom"
                        android:maxLines="1"
                        android:paddingStart="10dp"
                        android:paddingEnd="10dp"
                        android:paddingBottom="5dp"
                        android:shadowColor="@color/black"
                        android:shadowDx="2"
                        android:shadowDy="2"
                        android:shadowRadius="1"
                        android:textColor="#FFF"
                        android:textSize="12sp"
                        android:textStyle="bold" />


                </LinearLayout>



                <LinearLayout
                    android:id="@+id/active_pause_cancel_btns"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:animateLayoutChanges="true"
                    app:layout_constraintBottom_toTopOf="@+id/output"
                    app:layout_constraintEnd_toEndOf="parent"
                    android:layout_marginEnd="5dp"
                    app:layout_constraintTop_toBottomOf="@+id/linearlayout2_horizontalscrollview"
                    app:layout_constraintVertical_bias="0.51"
                    >

<!--                    <com.google.android.material.button.MaterialButton-->
<!--                        android:id="@+id/active_download_resume"-->
<!--                        style="?attr/materialIconButtonFilledStyle"-->
<!--                        android:layout_width="wrap_content"-->
<!--                        android:contentDescription="@string/resume"-->
<!--                        android:layout_height="wrap_content"-->
<!--                        app:backgroundTint="?attr/colorSurface"-->
<!--                        app:cornerRadius="15dp"-->
<!--                        app:icon="@drawable/exomedia_ic_play_arrow_white"-->
<!--                        app:iconSize="30dp"-->
<!--                        app:iconTint="?android:textColorPrimary"-->
<!--                        app:layout_constraintBottom_toTopOf="@+id/output"-->
<!--                        app:layout_constraintEnd_toEndOf="parent"-->
<!--                        app:layout_constraintTop_toBottomOf="@+id/linearlayout2_horizontalscrollview"-->
<!--                        app:layout_constraintVertical_bias="0.51" />-->

                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/active_download_delete"
                        style="?attr/materialIconButtonFilledStyle"
                        android:layout_width="wrap_content"
                        android:contentDescription="@string/Remove"
                        android:layout_height="wrap_content"
                        app:backgroundTint="?attr/colorSurface"
                        app:cornerRadius="15dp"
                        app:icon="@drawable/baseline_close_24"
                        app:iconSize="30dp"
                        app:iconTint="?android:textColorPrimary"
                        app:layout_constraintBottom_toTopOf="@+id/output"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintTop_toBottomOf="@+id/linearlayout2_horizontalscrollview"
                        app:layout_constraintVertical_bias="0.51" />

                </LinearLayout>



                <TextView
                    android:id="@+id/output"
                    android:layout_width="match_parent"
                    android:layout_height="45dp"
                    android:clickable="true"
                    android:ellipsize="end"
                    android:focusable="true"
                    android:fontFamily="monospace"
                    android:maxLines="2"
                    android:padding="10dp"
                    android:shadowColor="#000"
                    android:shadowDx="4"
                    android:shadowDy="4"
                    android:shadowRadius="2"
                    android:textColor="#FFF"
                    android:textSize="11sp"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent" />


            </androidx.constraintlayout.widget.ConstraintLayout>

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

</androidx.constraintlayout.widget.ConstraintLayout>