<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:fresco="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginLeft="4dp"
    android:layout_marginRight="4dp"
    android:layout_marginBottom="8dp">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/containerView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/download_dialog_item_background"
        android:orientation="vertical">

        <ProgressBar
            android:id="@+id/progressbar"
            style="?android:attr/progressBarStyleHorizontal"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:max="100"
            android:progress="50"
            android:progressDrawable="@drawable/download_dialog_item_progress"
            android:visibility="gone"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            tools:visibility="visible" />

        <com.facebook.drawee.view.SimpleDraweeView
            android:id="@+id/icon"
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:layout_marginLeft="8dp"
            android:layout_marginTop="8dp"
            android:layout_marginBottom="8dp"
            app:layout_constraintBottom_toTopOf="@+id/recommendDesTv"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            fresco:placeholderImage="@drawable/download_dialog_game_icon_placeholder"
            fresco:placeholderImageScaleType="fitXY"
            fresco:roundedCornerRadius="4dp"
            fresco:roundingBorderColor="@color/black_alpha_10"
            fresco:roundingBorderWidth="0.5dp" />

        <TextView
            android:id="@+id/name"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginLeft="8dp"
            android:includeFontPadding="false"
            android:singleLine="true"
            android:textColor="@color/text_title"
            android:textSize="12sp"
            app:layout_constraintBottom_toTopOf="@id/remark"
            app:layout_constraintLeft_toRightOf="@id/icon"
            app:layout_constraintRight_toLeftOf="@id/download_status_icon"
            app:layout_constraintTop_toTopOf="@id/icon"
            app:layout_constraintVertical_chainStyle="packed"
            tools:text="九游版" />

        <TextView
            android:id="@+id/remark"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginLeft="8dp"
            android:layout_marginTop="2dp"
            android:includeFontPadding="false"
            android:singleLine="true"
            android:textColor="@color/text_subtitleDesc"
            android:textSize="10sp"
            app:layout_constraintBottom_toTopOf="@id/status"
            app:layout_constraintLeft_toRightOf="@id/icon"
            app:layout_constraintRight_toLeftOf="@id/download_status_icon"
            app:layout_constraintTop_toBottomOf="@id/name"
            tools:text="备注" />

        <TextView
            android:id="@+id/status"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="8dp"
            android:layout_marginTop="2dp"
            android:drawablePadding="2dp"
            android:includeFontPadding="false"
            android:singleLine="true"
            android:textColor="@color/theme_font"
            android:textSize="10sp"
            app:layout_constraintBottom_toBottomOf="@id/icon"
            app:layout_constraintLeft_toRightOf="@id/icon"
            app:layout_constraintTop_toBottomOf="@id/remark"
            tools:text="点击启动" />

        <ImageView
            android:id="@+id/download_status_icon"
            android:layout_width="8dp"
            android:layout_height="8dp"
            android:layout_marginRight="8dp"
            app:srcCompat="@drawable/download_dialog_status_download_gray"
            app:layout_constraintBottom_toBottomOf="@+id/icon"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="@+id/icon" />

        <TextView
            android:id="@+id/recommendDesTv"
            android:layout_width="0dp"
            android:layout_height="20dp"
            android:background="@drawable/download_recommend_des_bg"
            android:gravity="center_vertical"
            android:maxLength="16"
            android:paddingLeft="8dp"
            android:paddingRight="8dp"
            android:textColor="@color/white"
            android:textSize="9dp"
            android:visibility="gone"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/icon"
            tools:text="大量用户下载了此版本" />

        <RelativeLayout
            android:id="@+id/install"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:visibility="gone"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            tools:visibility="visible">

            <TextView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@drawable/download_dialog_item_install_background"
                android:gravity="center"
                android:text="安装"
                android:textColor="@color/white"
                android:textSize="14sp" />

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

    <LinearLayout
        android:id="@+id/recommendLabel"
        android:layout_width="wrap_content"
        android:layout_height="14dp"
        android:layout_alignParentRight="true"
        android:layout_marginRight="8dp"
        android:orientation="horizontal"
        android:visibility="gone">

        <ImageView
            android:layout_width="10dp"
            android:layout_height="match_parent"
            app:srcCompat="@drawable/ic_recommend_label_left" />

        <TextView
            android:id="@+id/recommendLabelTv"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:background="@drawable/bg_recommend_label_middle"
            android:gravity="center_vertical"
            android:includeFontPadding="false"
            android:maxLength="10"
            android:textColor="@color/white"
            android:textSize="8sp"
            android:textStyle="bold" />

        <ImageView
            android:layout_width="6dp"
            android:layout_height="match_parent"
            app:srcCompat="@drawable/ic_recommend_label_right" />
    </LinearLayout>
</RelativeLayout>

