<?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:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:paddingLeft="16dp"
    android:paddingTop="11dp"
    android:paddingRight="16dp">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/game_info_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_constraintTop_toTopOf="parent">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/game_icon_container"
            android:layout_width="52dp"
            android:layout_height="58dp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <com.gh.gamecenter.feature.view.GameIconView
                android:id="@+id/game_icon"
                android:layout_width="48dp"
                android:layout_height="48dp"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

        </androidx.constraintlayout.widget.ConstraintLayout>

        <LinearLayout
            android:id="@+id/gameNameContainer"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="4dp"
            android:layout_marginTop="7dp"
            android:layout_marginEnd="8dp"
            android:gravity="center_vertical"
            android:orientation="horizontal"
            app:layout_constraintEnd_toStartOf="@+id/download_btn"
            app:layout_constraintStart_toEndOf="@+id/game_icon_container"
            app:layout_constraintTop_toTopOf="@+id/game_icon_container"
            app:layout_constraintVertical_chainStyle="packed">

            <TextView
                android:id="@+id/game_name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:includeFontPadding="false"
                android:singleLine="true"
                android:textColor="@color/text_title"
                android:textSize="16sp"
                android:textStyle="bold"
                tools:text="轩辕剑龙舞云山" />

            <TextView
                android:id="@+id/gameSubtitleTv"
                android:layout_width="wrap_content"
                android:layout_height="14dp"
                android:layout_marginStart="4dp"
                android:layout_marginLeft="4dp"
                android:background="@drawable/bg_advance_download_game_subtitle"
                android:paddingStart="2dp"
                android:paddingEnd="2dp"
                android:singleLine="true"
                android:textColor="@color/text_subtitle"
                android:textSize="@dimen/tag_text_size"
                android:visibility="gone"
                tools:text="副标题"
                tools:visibility="visible" />

            <TextView
                android:id="@+id/adLabelTv"
                android:layout_width="21dp"
                android:layout_height="14dp"
                android:layout_marginStart="4dp"
                android:layout_marginLeft="4dp"
                android:background="@drawable/bg_ad_label"
                android:gravity="center"
                android:text="AD"
                android:textColor="@color/white"
                android:textSize="@dimen/tag_text_size"
                android:visibility="gone"
                tools:visibility="visible" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/ratingAndTagContainer"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="6dp"
            android:layout_marginRight="40dp"
            android:gravity="center_vertical"
            android:orientation="horizontal"
            app:layout_constraintEnd_toStartOf="@+id/download_btn"
            app:layout_constraintStart_toStartOf="@id/gameNameContainer"
            app:layout_constraintTop_toBottomOf="@+id/gameNameContainer">

            <TextView
                android:id="@+id/game_rating"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginRight="8dp"
                android:drawablePadding="4dp"
                android:gravity="center"
                android:includeFontPadding="false"
                android:textColor="@color/theme"
                android:textSize="12sp"
                android:textStyle="bold"
                tools:text="9.3" />

            <com.gh.common.view.GameTagFlexLinearLayout
                android:id="@+id/game_tags"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />
        </LinearLayout>


        <com.gh.gamecenter.feature.view.DownloadButton
            android:id="@+id/download_btn"
            android:layout_width="60dp"
            android:layout_height="28dp"
            android:layout_marginLeft="8dp"
            android:visibility="gone"
            app:download_button_show_progress="true"
            app:download_button_text_size="12sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            tools:visibility="visible" />

        <TextView
            android:id="@+id/multiVersionDownloadTv"
            android:layout_width="wrap_content"
            android:layout_height="28dp"
            android:drawablePadding="2dp"
            android:gravity="center"
            android:text="展开"
            android:textColor="@color/white"
            android:textSize="@dimen/secondary_size"
            android:visibility="gone"
            app:drawableEndCompat="@drawable/ic_jump_universal"
            app:layout_constraintBottom_toBottomOf="@+id/download_btn"
            app:layout_constraintEnd_toEndOf="@+id/download_btn"
            app:layout_constraintStart_toStartOf="@+id/download_btn"
            app:layout_constraintTop_toTopOf="@+id/download_btn" />

        <com.airbnb.lottie.LottieAnimationView
            android:id="@+id/downloadTipsLottie"
            android:layout_width="16dp"
            android:layout_height="16dp"
            android:layout_marginTop="-8dp"
            android:visibility="gone"
            app:layout_constraintRight_toRightOf="@+id/download_btn"
            app:layout_constraintTop_toTopOf="@+id/download_btn"
            app:lottie_autoPlay="false"
            app:lottie_loop="true"
            app:lottie_repeatMode="restart" />

        <TextView
            android:id="@+id/game_rating2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="8dp"
            android:drawableLeft="@drawable/home_game_rating"
            android:drawablePadding="4dp"
            android:gravity="center"
            android:includeFontPadding="false"
            android:textColor="@color/theme"
            android:textSize="18sp"
            android:textStyle="bold"
            android:visibility="gone"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            tools:text="9.3" />

    </androidx.constraintlayout.widget.ConstraintLayout>

    <com.facebook.drawee.view.SimpleDraweeView
        android:id="@+id/game_image"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="12dp"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toBottomOf="@id/game_info_container"
        app:roundedCornerRadius="@dimen/home_large_image_radius"
        app:viewAspectRatio="1.78"
        tools:background="@color/placeholder_bg" />

    <com.gh.gamecenter.home.video.AutomaticVideoView
        android:id="@+id/autoVideoView"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginTop="12dp"
        android:visibility="gone"
        app:layout_constraintDimensionRatio="w,1:1.78"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/game_info_container"
        tools:visibility="visible" />


    <TextView
        android:id="@+id/game_brief"
        android:layout_width="0dp"
        android:layout_height="50dp"
        android:includeFontPadding="false"
        android:orientation="horizontal"
        android:paddingTop="12dp"
        android:singleLine="true"
        android:textColor="@color/text_title"
        android:textSize="14sp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/game_image"
        tools:text="这是一个很厉害的游戏" />

    <TextView
        android:id="@+id/detailBtn"
        android:layout_width="0dp"
        android:layout_height="44dp"
        android:drawableRight="@drawable/ic_home_video_arrow_right"
        android:gravity="center_vertical"
        android:paddingLeft="16dp"
        android:paddingRight="16dp"
        android:text="查看详情"
        android:textColor="@color/white"
        android:visibility="gone"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/game_image"
        tools:visibility="visible" />

</androidx.constraintlayout.widget.ConstraintLayout>
