<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
    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_toBottomOf="parent"
        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="12dp"
        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_container"
        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="12dp"
        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_container"
        app:layout_constraintTop_toBottomOf="@id/name"
        tools:text="备注" />

    <TextView
        android:id="@+id/status"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginLeft="12dp"
        android:layout_marginTop="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_constraintRight_toLeftOf="@id/download_status_container"
        app:layout_constraintTop_toBottomOf="@id/remark"
        tools:text="等待中" />

    <RelativeLayout
        android:id="@+id/download_status_container"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginRight="8dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <ImageView
            android:id="@+id/download_status_icon"
            android:layout_width="8dp"
            android:layout_height="8dp"
            android:layout_marginRight="12dp"
            app:srcCompat="@drawable/download_dialog_status_download_gray"
            android:visibility="gone" />

        <TextView
            android:id="@+id/launch"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="12dp"
            android:drawableLeft="@drawable/download_dialog_status_launch"
            android:drawablePadding="4dp"
            android:textColor="@color/theme"
            android:textSize="12sp"
            android:visibility="gone" />

        <TextView
            android:id="@+id/collection"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="4dp"
            android:layout_marginRight="12dp"
            android:layout_toRightOf="@id/collection_pluggable_hint"
            android:drawablePadding="4dp"
            android:includeFontPadding="false"
            android:text="查看合集"
            android:textColor="@color/text_body"
            android:textSize="12sp"
            android:visibility="visible"
            app:drawableRightCompat="@drawable/download_dialog_status_collection_gray" />

        <View
            android:id="@+id/collection_pluggable_hint"
            android:layout_width="6dp"
            android:layout_height="6dp"
            android:layout_centerVertical="true"
            android:background="@drawable/download_dialog_collection_pluggable_hint"
            android:visibility="gone" />

        <TextView
            android:id="@+id/pluggable"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="4dp"
            android:background="@drawable/game_item_btn_plugin_style"
            android:drawableLeft="@drawable/download_dialog_status_pluggable"
            android:drawablePadding="4dp"
            android:paddingLeft="12dp"
            android:paddingTop="4dp"
            android:paddingRight="12dp"
            android:paddingBottom="4dp"
            android:textColor="@color/white"
            android:textSize="12sp"
            android:visibility="gone" />

        <TextView
            android:id="@+id/update"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="4dp"
            android:background="@drawable/game_item_btn_download_style"
            android:drawableLeft="@drawable/download_dialog_status_update"
            android:drawablePadding="4dp"
            android:paddingLeft="12dp"
            android:paddingTop="4dp"
            android:paddingRight="12dp"
            android:paddingBottom="4dp"
            android:textColor="@color/white"
            android:textSize="12sp"
            android:visibility="gone" />

    </RelativeLayout>

    <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>

