<?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:tools="http://schemas.android.com/tools"
    android:id="@+id/wrapperLl"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <com.gh.gamecenter.common.view.StatusBarView
        android:id="@+id/statusBar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/ui_surface" />

    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:id="@+id/coordinator"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:clipChildren="false"
        android:layout_weight="1">

        <com.gh.gamecenter.common.view.HomeSmartRefreshLayout
            android:id="@+id/refreshLayout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_behavior="@string/appbar_scrolling_view_behavior"
            app:srlDragRate="0.8"
            app:srlEnableRefresh="false">

            <com.gh.gamecenter.common.view.HomeTwoLevelHeader
                android:id="@+id/twoLevelHeader"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:srlFloorBottomDragLayoutRate="1"
                app:srlFloorRate="2">

                <androidx.constraintlayout.widget.ConstraintLayout
                    android:id="@+id/headerContainer"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="@color/black">

                    <com.facebook.drawee.view.SimpleDraweeView
                        android:id="@+id/gameImageIv"
                        android:layout_width="0dp"
                        android:layout_height="0dp"
                        app:actualImageScaleType="centerCrop"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintDimensionRatio="1"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toTopOf="parent" />

                    <com.gh.gamecenter.home.video.AutomaticVideoView
                        android:id="@+id/autoVideoView"
                        android:layout_width="0dp"
                        android:layout_height="0dp"
                        app:avRadius="0"
                        app:layout_constraintDimensionRatio="1"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toTopOf="parent" />

                    <View
                        android:id="@+id/topMaskView"
                        android:layout_width="0dp"
                        android:layout_height="0dp"
                        android:background="@drawable/home_push_video_gradient_mask_top"
                        app:layout_constraintTop_toTopOf="parent"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toStartOf="parent" />

                    <View
                        android:id="@+id/bottomMaskView"
                        android:layout_width="0dp"
                        android:layout_height="136dp"
                        android:background="@drawable/home_push_video_gradient_mask_bottom"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toStartOf="parent" />

                    <LinearLayout
                        android:id="@+id/gameNameContainer"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginBottom="12dp"
                        android:gravity="center_vertical"
                        android:orientation="horizontal"
                        app:layout_constraintBottom_toTopOf="@+id/descTv"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toStartOf="parent">

                        <TextView
                            android:id="@+id/gameNameTv"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:includeFontPadding="false"
                            android:singleLine="true"
                            android:textColor="@color/white"
                            android:textSize="22sp"
                            android:textStyle="bold" />

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

                    <TextView
                        android:id="@+id/descTv"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginBottom="12dp"
                        android:includeFontPadding="false"
                        android:textColor="@color/white_alpha_60"
                        app:layout_constraintBottom_toTopOf="@+id/downloadBtn"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toStartOf="parent" />

                    <com.gh.gamecenter.feature.view.DownloadButton
                        android:id="@+id/downloadBtn"
                        android:layout_width="56dp"
                        android:layout_height="28dp"
                        android:layout_marginBottom="24dp"
                        app:download_button_download_style="1"
                        app:download_button_show_progress="true"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toStartOf="parent" />

                    <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/downloadBtn"
                        app:layout_constraintEnd_toEndOf="@+id/downloadBtn"
                        app:layout_constraintStart_toStartOf="@+id/downloadBtn"
                        app:layout_constraintTop_toTopOf="@+id/downloadBtn" />

                    <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/downloadBtn"
                        app:layout_constraintTop_toTopOf="@+id/downloadBtn"
                        app:lottie_autoPlay="false"
                        app:lottie_loop="true"
                        app:lottie_repeatMode="restart" />

                    <ImageView
                        android:id="@+id/muteIv"
                        android:layout_width="28dp"
                        android:layout_height="28dp"
                        android:layout_marginEnd="12dp"
                        android:layout_marginBottom="24dp"
                        android:padding="4dp"
                        android:visibility="gone"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:srcCompat="@drawable/ic_basic_offsound"
                        app:tint="@color/text_instance" />

                    <View
                        android:id="@+id/headerBackground"
                        android:layout_width="0dp"
                        android:layout_height="0dp"
                        android:background="@color/ui_surface"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toTopOf="parent" />

                </androidx.constraintlayout.widget.ConstraintLayout>

                <com.gh.gamecenter.common.view.HomeRefreshHeader
                    android:id="@+id/classicsHeader"
                    android:layout_width="match_parent"
                    android:layout_height="48dp"
                    app:srlAccentColor="@color/text_tertiary"
                    app:srlDrawableArrowSize="16dp"
                    app:srlDrawableMarginRight="4dp"
                    app:srlEnableLastTime="false"
                    app:srlDrawableProgressSize="0dp"
                    app:srlTextPulling="@string/home_header_pulling"
                    app:srlTextRelease="@string/home_header_release"
                    app:srlPrimaryColor="@color/ui_surface"
                    app:srlTextSizeTitle="@dimen/primary_text_size" />
            </com.gh.gamecenter.common.view.HomeTwoLevelHeader>

            <FrameLayout
                android:id="@+id/contentContainer"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginTop="-8dp"
                android:background="@color/transparent"
                android:orientation="vertical"
                app:layout_srlBackgroundColor="@color/transparent">

                <LinearLayout
                    android:id="@+id/backgroundContainer"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="vertical">

                    <FrameLayout
                        android:id="@+id/wrapper_main_content"
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        android:layout_marginTop="8dp"
                        android:layout_weight="1"/>

                </LinearLayout>
            </FrameLayout>
        </com.gh.gamecenter.common.view.HomeSmartRefreshLayout>

        <com.google.android.material.appbar.AppBarLayout
            android:id="@+id/appbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/transparent"
            app:elevation="0dp"
            app:layout_behavior="com.gh.gamecenter.common.view.FixAppBarLayoutBehavior">

            <com.google.android.material.appbar.CollapsingToolbarLayout
                android:id="@+id/collapsingToolbar"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:fitsSystemWindows="true"
                app:layout_scrollFlags="noScroll">

                <View
                    android:id="@+id/toolbarBackground"
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/appbar_height"
                    android:background="@color/ui_surface" />

                <include
                    android:id="@+id/toolbar"
                    layout="@layout/reuse_toolbar" />

            </com.google.android.material.appbar.CollapsingToolbarLayout>

        </com.google.android.material.appbar.AppBarLayout>
    </androidx.coordinatorlayout.widget.CoordinatorLayout>
</LinearLayout>