<?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:squareImageView="http://schemas.android.com/apk/de.danoeh.antennapod"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:clipToPadding="false">

    <androidx.cardview.widget.CardView
        android:id="@+id/card"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:clickable="true"
        android:foreground="?android:attr/selectableItemBackground"
        android:layout_margin="4dp"
        app:cardBackgroundColor="?attr/colorSurfaceContainer"
        app:cardCornerRadius="12dp"
        app:cardElevation="1dp">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <androidx.cardview.widget.CardView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="1px"
                app:cardCornerRadius="12dp"
                app:cardBackgroundColor="@android:color/transparent"
                app:cardElevation="0dp">

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:orientation="vertical">

                    <FrameLayout
                        android:layout_width="128dp"
                        android:layout_height="128dp"
                        android:background="@color/image_readability_tint">

                        <de.danoeh.antennapod.ui.common.SquareImageView
                            android:id="@+id/cover"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:outlineProvider="bounds"
                            squareImageView:direction="width"
                            tools:src="@tools:sample/avatars" />

                        <ImageView
                            android:layout_width="48dp"
                            android:layout_height="48dp"
                            android:layout_gravity="bottom|end"
                            android:layout_margin="4dp"
                            android:padding="3dp"
                            app:srcCompat="@drawable/bg_circle" />

                        <de.danoeh.antennapod.ui.common.CircularProgressBar
                            android:id="@+id/circularProgressBar"
                            android:layout_width="48dp"
                            android:layout_height="48dp"
                            android:layout_gravity="bottom|end"
                            android:layout_margin="4dp"
                            app:foregroundColor="?attr/colorOnPrimary" />

                        <ImageView
                            android:id="@+id/secondaryActionIcon"
                            android:layout_width="48dp"
                            android:layout_height="48dp"
                            android:layout_gravity="bottom|end"
                            android:layout_margin="4dp"
                            android:clickable="true"
                            android:foreground="?attr/selectableItemBackgroundBorderless"
                            android:padding="12dp"
                            app:srcCompat="@drawable/ic_play_24dp"
                            app:tint="?attr/colorOnPrimary"
                            app:tintMode="src_atop" />

                    </FrameLayout>

                    <com.google.android.material.progressindicator.LinearProgressIndicator
                        android:id="@+id/progressBar"
                        android:layout_width="match_parent"
                        android:layout_height="4dp"
                        android:layout_gravity="bottom"
                        android:max="100"
                        app:trackStopIndicatorSize="0dp"
                        tools:progress="50" />

                </LinearLayout>

            </androidx.cardview.widget.CardView>

            <View
                android:id="@+id/progressBarReplacementSpacer"
                android:layout_width="match_parent"
                android:layout_height="4dp"
                android:visibility="gone" />

            <TextView
                android:id="@+id/titleLabel"
                android:layout_width="128dp"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"
                android:ellipsize="end"
                android:lines="2"
                android:paddingHorizontal="4dp"
                android:singleLine="false"
                android:textColor="?android:attr/textColorPrimary"
                android:textSize="14sp"
                tools:text="@sample/episodes.json/data/title" />

            <TextView
                android:id="@+id/dateLabel"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="4dp"
                android:paddingHorizontal="4dp"
                android:singleLine="true"
                android:textAlignment="textStart"
                android:textSize="14sp"
                tools:text="@sample/episodes.json/data/published_at"
                style="@style/AntennaPod.TextView.ListItemSecondaryTitle" />

        </LinearLayout>

    </androidx.cardview.widget.CardView>

</LinearLayout>
