<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout 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="match_parent"
    android:fitsSystemWindows="true"
    android:orientation="vertical">

    <com.google.android.material.appbar.AppBarLayout
        android:id="@+id/gamedetail_appbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/background_white"
        android:fitsSystemWindows="true"
        android:gravity="center"
        app:layout_behavior=".common.view.FixAppBarLayoutBehavior"
        tools:visibility="visible">

        <com.google.android.material.appbar.CollapsingToolbarLayout
            android:id="@+id/collapsingToolbar"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fitsSystemWindows="true"
            app:contentScrim="@color/background_white"
            app:layout_scrollFlags="scroll|exitUntilCollapsed"
            app:scrimAnimationDuration="0"
            app:scrimVisibleHeightTrigger="105dp"
            app:titleEnabled="false">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:fitsSystemWindows="true"
                android:gravity="center_horizontal"
                android:orientation="vertical">

                <include
                    android:id="@+id/game_detail_video"
                    layout="@layout/piece_game_detail_video" />

                <androidx.constraintlayout.widget.ConstraintLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:paddingLeft="16dp"
                    android:paddingTop="16dp"
                    android:paddingRight="16dp"
                    android:paddingBottom="12dp">

                    <RelativeLayout
                        android:id="@+id/gameIconContainer"
                        android:layout_width="96dp"
                        android:layout_height="88dp"
                        android:layout_marginRight="12dp"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toTopOf="parent">

                        <com.gh.common.view.GameIconView
                            android:id="@+id/gamedetail_iv_thumb"
                            android:layout_width="88dp"
                            android:layout_height="88dp"
                            android:layout_centerHorizontal="true"
                            app:gameIconFadeDuration="0" />

                        <LinearLayout
                            android:id="@+id/gameDetailRankLl"
                            android:layout_width="match_parent"
                            android:layout_height="25dp"
                            android:layout_alignParentBottom="true"
                            android:background="@drawable/bg_game_detail_rank"
                            android:orientation="horizontal"
                            android:visibility="gone"
                            tools:visibility="visible">

                            <ImageView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginLeft="6dp"
                                android:layout_marginTop="7dp"
                                android:src="@drawable/ic_game_detail_rank_trophy" />

                            <TextView
                                android:id="@+id/gameDetailRankTv"
                                android:layout_width="0dp"
                                android:layout_height="wrap_content"
                                android:layout_centerHorizontal="true"
                                android:layout_marginLeft="2dp"
                                android:layout_marginTop="8dp"
                                android:layout_marginRight="2dp"
                                android:layout_weight="1"
                                android:ellipsize="marquee"
                                android:gravity="center"
                                android:includeFontPadding="false"
                                android:marqueeRepeatLimit="marquee_forever"
                                android:singleLine="true"
                                android:textColor="@color/white"
                                android:textSize="9sp"
                                android:textStyle="bold"
                                tools:text="预约榜第1名" />

                            <ImageView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginTop="8dp"
                                android:layout_marginRight="6dp"
                                android:src="@drawable/ic_game_detail_rank_arrow" />
                        </LinearLayout>
                    </RelativeLayout>

                    <LinearLayout
                        android:id="@+id/gameTitleContainer"
                        android:layout_width="0dp"
                        android:layout_height="70dp"
                        android:layout_marginLeft="8dp"
                        android:gravity="center_vertical"
                        android:orientation="vertical"
                        app:layout_constraintEnd_toStartOf="@+id/rating_score_container"
                        app:layout_constraintStart_toEndOf="@+id/gameIconContainer"
                        app:layout_constraintTop_toTopOf="@+id/gameIconContainer">

                        <TextView
                            android:id="@+id/gamedetail_tv_name"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:ellipsize="end"
                            android:includeFontPadding="false"
                            android:lineSpacingExtra="2dp"
                            android:maxLines="2"
                            android:textColor="@color/text_title"
                            android:textSize="16sp"
                            android:textStyle="bold"
                            tools:text="地海争霸2" />

                        <com.gh.common.view.FlexLinearLayout
                            android:id="@+id/gamedetail_gametag"
                            android:layout_width="match_parent"
                            android:layout_height="20dp"
                            android:layout_marginTop="4dp"
                            android:clipToPadding="false"
                            android:orientation="horizontal" />
                    </LinearLayout>

                    <ImageView
                        android:id="@+id/recommendAgeIv"
                        android:layout_width="76dp"
                        android:layout_height="14dp"
                        android:layout_marginLeft="8dp"
                        android:visibility="gone"
                        app:layout_constraintBottom_toBottomOf="@+id/gameIconContainer"
                        app:layout_constraintStart_toEndOf="@+id/gameIconContainer"
                        tools:src="@drawable/ic_recommend_age8"
                        tools:visibility="visible" />

                    <TextView
                        android:id="@+id/realnameHintTv"
                        android:layout_width="wrap_content"
                        android:layout_height="14dp"
                        android:layout_marginStart="8dp"
                        android:background="@drawable/bg_ebf8ff_radius_2"
                        android:gravity="center"
                        android:paddingEnd="6dp"
                        android:paddingStart="6dp"
                        android:paddingTop="0.5dp"
                        android:text="登陆游戏后需进行实名认证"
                        android:textColor="@color/theme_font"
                        android:textSize="@dimen/tag_text_size"
                        android:includeFontPadding="false"
                        android:visibility="gone"
                        app:layout_constraintBottom_toBottomOf="@id/gameIconContainer"
                        app:layout_constraintStart_toEndOf="@id/recommendAgeIv"
                        tools:visibility="visible" />

                    <RelativeLayout
                        android:id="@+id/rating_score_container"
                        android:layout_width="64dp"
                        android:layout_height="64dp"
                        android:layout_marginLeft="6dp"
                        android:visibility="gone"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toEndOf="@+id/gameTitleContainer"
                        app:layout_constraintTop_toTopOf="parent"
                        tools:visibility="visible">

                        <ImageView
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:src="@drawable/bg_game_detail_rating_score" />

                        <TextView
                            android:id="@+id/rating_score_average"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_centerInParent="true"
                            android:gravity="center"
                            android:textColor="@color/white"
                            android:textSize="18sp"
                            android:textStyle="bold"
                            tools:text="8.5" />

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

                <TextView
                    android:id="@+id/gameBigEvent"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="left"
                    android:layout_marginLeft="16dp"
                    android:layout_marginRight="16dp"
                    android:layout_marginBottom="16dp"
                    android:background="@drawable/bg_game_big_event"
                    android:drawableLeft="@drawable/ic_game_detail_big_event_gray"
                    android:drawableRight="@drawable/ic_game_detail_big_event_arrow_gray"
                    android:drawablePadding="3dp"
                    android:ellipsize="end"
                    android:includeFontPadding="false"
                    android:maxLines="1"
                    android:padding="4dp"
                    android:textColor="@color/text_subtitleDesc"
                    android:textSize="10sp"
                    android:visibility="gone"
                    tools:text="游戏大事件游戏大事件"
                    tools:visibility="visible" />

                <LinearLayout
                    android:id="@+id/contentCardContainer"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:paddingStart="16dp"
                    android:paddingEnd="16dp"
                    android:paddingBottom="8dp"
                    android:visibility="gone" />

                <View
                    android:id="@+id/toolbarGapView"
                    android:layout_width="match_parent"
                    android:layout_height="8dp"
                    android:background="@color/background" />
            </LinearLayout>

            <androidx.appcompat.widget.Toolbar
                android:id="@+id/toolbar"
                style="@style/Base_ToolbarStyle"
                android:layout_width="match_parent"
                android:layout_height="44dp"
                android:background="@android:color/transparent"
                app:contentInsetStartWithNavigation="0dp"
                app:layout_collapseMode="pin">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:background="@color/transparent"
                    android:gravity="center_vertical"
                    android:orientation="horizontal"
                    android:translationX="-10dp">

                    <com.gh.common.view.GameIconView
                        android:id="@+id/gamedetail_thumb_small"
                        android:layout_width="28dp"
                        android:layout_height="28dp"
                        android:visibility="gone"
                        tools:visibility="visible" />

                    <TextView
                        android:id="@+id/titleTv"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="8dp"
                        android:ellipsize="end"
                        android:maxLines="1"
                        android:textSize="16sp"
                        android:textStyle="bold" />
                </LinearLayout>
            </androidx.appcompat.widget.Toolbar>

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

        <RelativeLayout
            android:id="@+id/gamedetail_tabbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <com.gh.gamecenter.common.view.TabIndicatorView
                android:id="@+id/tab_indicator"
                android:layout_width="match_parent"
                android:layout_height="@dimen/default_tab_indicator_height"
                android:layout_alignParentBottom="true" />

            <com.google.android.material.tabs.TabLayout
                android:id="@+id/tab_layout"
                android:layout_width="match_parent"
                android:layout_height="@dimen/tab_layout_height"
                app:tabIndicator="@null"
                app:tabTextAppearance="@style/TabLayoutTextAppearance" />

        </RelativeLayout>
    </com.google.android.material.appbar.AppBarLayout>

    <com.lightgame.view.NoScrollableViewPager
        android:id="@+id/gamedetail_vp"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:overScrollMode="never"
        app:layout_behavior="@string/appbar_scrolling_view_behavior" />

</androidx.coordinatorlayout.widget.CoordinatorLayout>