<?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="match_parent"
    android:layout_height="wrap_content"
    android:paddingHorizontal="16dp"
    android:paddingVertical="8dp"
    android:foreground="?attr/selectableItemBackground"
    android:orientation="horizontal">

    <androidx.cardview.widget.CardView
        android:layout_width="56dp"
        android:layout_height="56dp"
        android:clickable="false"
        app:cardBackgroundColor="@color/non_square_icon_background"
        app:cardCornerRadius="12dp"
        app:cardElevation="0dp">

        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="1px">

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

            <TextView
                android:id="@+id/fallbackTitleLabel"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignStart="@+id/coverImage"
                android:layout_alignLeft="@+id/coverImage"
                android:layout_alignTop="@+id/coverImage"
                android:layout_alignEnd="@+id/coverImage"
                android:layout_alignRight="@+id/coverImage"
                android:layout_alignBottom="@+id/coverImage"
                android:background="@color/feed_text_bg"
                android:gravity="center"
                android:ellipsize="end"
                android:padding="6dp"
                android:textColor="#fff"
                tools:text="@sample/episodes.json/data/title" />

        </RelativeLayout>

    </androidx.cardview.widget.CardView>

    <TextView
        android:id="@+id/titleLabel"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginHorizontal="8dp"
        android:layout_gravity="center_vertical"
        android:layout_weight="1"
        android:ellipsize="end"
        android:gravity="start"
        android:maxLines="2"
        android:importantForAccessibility="no"
        style="@style/AntennaPod.TextView.ListItemPrimaryTitle"
        tools:text="@sample/episodes.json/data/title" />

    <TextView
        android:id="@+id/countViewPill"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:text="3"
        android:textColor="?android:attr/textColorTertiary"
        android:textSize="14sp" />

    <ImageView
        android:id="@+id/errorIcon"
        android:layout_width="24dp"
        android:layout_height="24dp"
        android:layout_margin="8dp"
        android:visibility="gone"
        android:layout_gravity="center_vertical"
        android:contentDescription="@string/refresh_failed_msg"
        app:srcCompat="@drawable/ic_error"
        tools:visibility="visible" />

</LinearLayout>
