<?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:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true"
        android:layout_above="@+id/input_container">

        <com.google.android.material.appbar.AppBarLayout
            android:id="@+id/appbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:fitsSystemWindows="true"
            android:background="@color/background_white"
            android:gravity="center"
            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="scroll|exitUntilCollapsed"
                app:titleEnabled="false">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_horizontal"
                    android:orientation="vertical">

                    <include
                        android:visibility="gone"
                        android:id="@+id/imageItem"
                        layout="@layout/game_collection_detail_image_item" />

                    <include
                        android:visibility="gone"
                        android:id="@+id/videoItem"
                        layout="@layout/game_collection_detail_video_item" />

                    <HorizontalScrollView
                        android:visibility="gone"
                        android:id="@+id/tagContainer"
                        android:layout_width="match_parent"
                        android:layout_height="44dp"
                        android:scrollbars="none"
                        android:background="@color/background_white"
                        android:nestedScrollingEnabled="false">

                        <LinearLayout
                            android:id="@+id/tagList"
                            android:layout_width="wrap_content"
                            android:layout_height="match_parent"
                            android:paddingLeft="16dp"
                            android:paddingRight="16dp"
                            android:gravity="center_vertical"
                            android:orientation="horizontal" />
                    </HorizontalScrollView>

                    <RelativeLayout
                        android:visibility="gone"
                        android:id="@+id/playedContainer"
                        android:layout_width="match_parent"
                        android:layout_height="44dp"
                        android:paddingLeft="16dp"
                        android:paddingRight="16dp"
                        android:orientation="horizontal"
                        android:background="@color/background_white">

                        <ProgressBar
                            android:id="@+id/playedPro"
                            style="?android:attr/progressBarStyleHorizontal"
                            android:layout_width="100dp"
                            android:layout_height="10dp"
                            android:layout_centerVertical="true"
                            android:progressDrawable="@drawable/progressbar_played_game_blue_style" />

                        <TextView
                            android:id="@+id/playedTv"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginLeft="8dp"
                            android:layout_centerVertical="true"
                            android:layout_alignParentRight="true"
                            android:includeFontPadding="false"
                            android:textColor="@color/text_subtitleDesc"
                            android:textSize="10sp"
                            tools:text="玩过 28 / 28 款" />
                    </RelativeLayout>

                    <View
                        android:visibility="gone"
                        android:id="@+id/divider"
                        android:layout_width="match_parent"
                        android:layout_height="1px"
                        android:background="@color/divider" />
                </LinearLayout>

                <androidx.appcompat.widget.Toolbar
                    android:id="@+id/toolbar"
                    android:layout_width="match_parent"
                    android:layout_height="48dp"
                    app:layout_collapseMode="pin"
                    app:navigationIcon="@null">

                    <androidx.constraintlayout.widget.ConstraintLayout
                        android:id="@+id/toolbar_container"
                        android:layout_width="match_parent"
                        android:layout_height="48dp"
                        android:background="@android:color/transparent">

                        <ImageView
                            android:id="@+id/backIv"
                            android:layout_width="wrap_content"
                            android:layout_height="48dp"
                            android:layout_centerVertical="true"
                            android:paddingLeft="13dp"
                            android:paddingRight="11dp"
                            android:src="@drawable/ic_toolbar_back_white"
                            app:layout_constraintLeft_toLeftOf="parent"
                            app:layout_constraintTop_toTopOf="parent" />

                        <LinearLayout
                            android:visibility="gone"
                            android:id="@+id/toolbarUserContainer"
                            android:layout_width="wrap_content"
                            android:layout_height="48dp"
                            android:gravity="center_vertical"
                            android:orientation="horizontal"
                            app:layout_constraintLeft_toRightOf="@+id/backIv"
                            app:layout_constraintTop_toTopOf="@+id/backIv"
                            app:layout_constraintBottom_toBottomOf="@+id/backIv">

                            <com.gh.gamecenter.common.view.AvatarBorderView
                                android:id="@+id/toolbarUserIcon"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                app:avatar_width="28dp"
                                app:badge_width="8dp"
                                app:border_ratio="1"
                                tools:layout_height="28dp"
                                tools:layout_width="28dp" />

                            <TextView
                                android:id="@+id/toolbarUserName"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginLeft="8dp"
                                android:includeFontPadding="false"
                                android:textColor="@color/text_title"
                                android:textSize="16sp"
                                tools:text="测试用户名" />
                        </LinearLayout>

                        <TextView
                            tools:visibility="visible"
                            android:visibility="gone"
                            android:id="@+id/toolbarFollowTv"
                            android:layout_width="48dp"
                            android:layout_height="24dp"
                            android:gravity="center"
                            android:background="@drawable/button_round_f5f5f5"
                            android:textColor="@color/white"
                            android:textSize="12sp"
                            android:text="关注"
                            app:layout_goneMarginRight="12dp"
                            app:layout_constraintTop_toTopOf="@+id/backIv"
                            app:layout_constraintBottom_toBottomOf="@+id/backIv"
                            app:layout_constraintRight_toLeftOf="@+id/squareIv" />

                        <ImageView
                            tools:visibility="visible"
                            android:visibility="gone"
                            android:id="@+id/squareIv"
                            android:layout_width="wrap_content"
                            android:layout_height="48dp"
                            android:paddingLeft="12dp"
                            android:paddingRight="12dp"
                            android:src="@drawable/ic_game_collection_square_light"
                            app:layout_constraintTop_toTopOf="@+id/backIv"
                            app:layout_constraintBottom_toBottomOf="@+id/backIv"
                            app:layout_constraintRight_toRightOf="parent" />
                    </androidx.constraintlayout.widget.ConstraintLayout>
                </androidx.appcompat.widget.Toolbar>
            </com.google.android.material.appbar.CollapsingToolbarLayout>
        </com.google.android.material.appbar.AppBarLayout>

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/list_rv"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/background_white"
            android:overScrollMode="never"
            app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior" />
    </androidx.coordinatorlayout.widget.CoordinatorLayout>

    <View
        android:id="@+id/bottomShadowView"
        android:layout_width="match_parent"
        android:layout_height="6dp"
        android:layout_above="@id/input_container"
        android:alpha="0.3"
        android:background="@drawable/shadow" />

    <include
        android:id="@+id/input_container"
        layout="@layout/piece_article_input_container" />

    <include
        android:id="@+id/fixedTopFilterView"
        layout="@layout/piece_article_detail_comment_filter"
        android:layout_width="match_parent"
        android:layout_height="44dp"
        android:visibility="gone" />

    <FrameLayout
        android:layout_above="@+id/input_container"
        android:id="@+id/list_skeleton"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <include
        layout="@layout/reuse_loading"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true" />

    <include layout="@layout/reuse_no_connection" />

    <include layout="@layout/reuse_none_data" />

    <include layout="@layout/reuse_data_exception" />
</RelativeLayout>