<?xml version="1.0" encoding="utf-8"?>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout 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/list_refresh"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/background"
    android:fitsSystemWindows="false">

    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:descendantFocusability="blocksDescendants"
        android:fitsSystemWindows="false"
        android:paddingBottom="54dp">

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

            <com.gh.common.view.CollapsingMotionLayout
                android:id="@+id/motionLayout"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:layoutDescription="@xml/personal_scene"
                app:layout_scrollFlags="scroll|exitUntilCollapsed|snap">

                <View
                    android:id="@+id/whiteBg"
                    android:layout_width="match_parent"
                    android:layout_height="200dp"
                    android:background="@color/background_white" />

                <View
                    android:id="@+id/gradientBg"
                    android:layout_width="match_parent"
                    android:layout_height="200dp"
                    android:background="@drawable/bg_personal_top_gradient" />

                <View
                    android:id="@+id/colorBg"
                    android:layout_width="match_parent"
                    android:layout_height="200dp"
                    android:background="@drawable/bg_personal_top_color" />

                <com.gh.gamecenter.common.view.AvatarBorderView
                    android:id="@+id/personal_user_icon"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    app:avatar_width="56dp"
                    app:badge_width="18dp"
                    app:border_width="1dp" />

                <TextView
                    android:id="@+id/personal_user_name"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:includeFontPadding="false"
                    android:text="立即登录"
                    android:textColor="@color/text_title"
                    android:textSize="16sp"
                    android:textStyle="bold"
                    tools:text="姓名" />

                <TextView
                    android:id="@+id/userIdTv"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:includeFontPadding="false"
                    android:text="解锁更多精彩内容"
                    android:textColor="@color/text_subtitleDesc"
                    android:textSize="11sp" />

                <RelativeLayout
                    android:id="@+id/personal_badge"
                    android:layout_width="wrap_content"
                    android:layout_height="20dp"
                    android:background="@drawable/bg_user_badge"
                    android:orientation="horizontal"
                    android:paddingStart="4dp"
                    android:paddingLeft="4dp"
                    android:visibility="gone"
                    tools:visibility="visible">

                    <com.facebook.drawee.view.SimpleDraweeView
                        android:id="@+id/personal_badge_icon"
                        android:layout_width="12dp"
                        android:layout_height="12dp"
                        android:layout_centerVertical="true"
                        app:placeholderImage="@drawable/ic_badge_default" />

                    <TextView
                        android:id="@+id/personal_badge_count_tv"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_centerVertical="true"
                        android:layout_marginStart="4dp"
                        android:layout_marginEnd="2dp"
                        android:layout_toEndOf="@+id/personal_badge_icon"
                        android:includeFontPadding="false"
                        android:textColor="@color/white"
                        android:textSize="10sp"
                        android:textStyle="bold"
                        tools:text="3"
                        tools:visibility="visible" />

                    <ImageView
                        android:id="@+id/personal_badge_arrow"
                        android:layout_width="5dp"
                        android:layout_height="8dp"
                        android:layout_centerVertical="true"
                        android:layout_marginStart="4dp"
                        android:layout_marginLeft="4dp"
                        android:layout_marginEnd="6dp"
                        android:layout_marginRight="6dp"
                        android:layout_toEndOf="@+id/personal_badge_count_tv"
                        android:layout_toRightOf="@+id/personal_badge_count_tv"
                        app:srcCompat="@drawable/ic_jump_badge" />

                    <ImageView
                        android:id="@+id/personal_badge_tips"
                        android:layout_width="4dp"
                        android:layout_height="4dp"
                        android:layout_marginTop="2dp"
                        android:layout_toLeftOf="@+id/personal_badge_arrow"
                        android:src="@drawable/oval_hint_red_bg"
                        android:visibility="gone"
                        tools:visibility="visible" />
                </RelativeLayout>

                <ImageView
                    android:id="@+id/iv_arrow"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    app:srcCompat="@drawable/ic_jump" />

            </com.gh.common.view.CollapsingMotionLayout>
        </com.google.android.material.appbar.AppBarLayout>

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

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

            <androidx.constraintlayout.widget.ConstraintLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <ImageView
                    android:id="@+id/darkModeIv"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="12dp"
                    android:layout_marginEnd="24dp"
                    android:layout_marginRight="24dp"
                    app:layout_constraintEnd_toStartOf="@+id/personal_sign"
                    app:layout_constraintTop_toTopOf="parent"
                    app:srcCompat="@drawable/ic_personal_dark_mode" />

                <ImageView
                    android:id="@+id/personal_sign"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="12dp"
                    android:layout_marginEnd="12dp"
                    android:layout_marginRight="12dp"
                    app:layout_constraintEnd_toStartOf="@+id/msg_rl"
                    app:layout_constraintTop_toTopOf="parent"
                    app:srcCompat="@drawable/ic_personal_sign" />

                <RelativeLayout
                    android:id="@+id/msg_rl"
                    android:layout_width="48dp"
                    android:layout_height="48dp"
                    android:layout_marginEnd="4dp"
                    android:layout_marginRight="4dp"
                    app:layout_constraintEnd_toEndOf="parent">

                    <ImageView
                        android:id="@+id/personal_msg"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_centerInParent="true"
                        app:srcCompat="@drawable/ic_personal_message" />

                    <TextView
                        android:id="@+id/login_message_hint"
                        android:layout_width="14dp"
                        android:layout_height="14dp"
                        android:layout_alignTop="@id/personal_msg"
                        android:layout_alignParentRight="true"
                        android:layout_marginRight="2dp"
                        android:background="@drawable/oval_hint_red_stroke_bg"
                        android:gravity="center"
                        android:includeFontPadding="false"
                        android:textColor="@color/white"
                        android:textSize="8sp"
                        android:textStyle="bold"
                        tools:text="12" />
                </RelativeLayout>
            </androidx.constraintlayout.widget.ConstraintLayout>
        </LinearLayout>

        <androidx.core.widget.NestedScrollView
            android:id="@+id/nestedScrollView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:overScrollMode="never"
            app:behavior_overlapTop="33dp"
            app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">

            <LinearLayout
                android:id="@+id/bodyContainer"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:paddingStart="16dp"
                android:paddingEnd="16dp"
                android:paddingBottom="16dp">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="68dp"
                    android:background="@drawable/bg_shape_white_radius_8"
                    android:gravity="center"
                    android:orientation="horizontal"
                    android:paddingStart="4dp"
                    android:paddingEnd="4dp">

                    <TextView
                        android:id="@+id/myGameTv"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:drawablePadding="2dp"
                        android:gravity="center"
                        android:includeFontPadding="false"
                        android:text="我的游戏"
                        android:textColor="@color/text_title"
                        android:textSize="@dimen/little_secondary_size"
                        app:drawableTopCompat="@drawable/ic_personal_my_game" />

                    <TextView
                        android:id="@+id/myPostTv"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:drawablePadding="2dp"
                        android:gravity="center"
                        android:includeFontPadding="false"
                        android:text="我的发布"
                        android:textColor="@color/text_title"
                        android:textSize="@dimen/little_secondary_size"
                        app:drawableTopCompat="@drawable/ic_personal_my_post" />

                    <TextView
                        android:id="@+id/myGameCollectionTv"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:drawablePadding="2dp"
                        android:gravity="center"
                        android:includeFontPadding="false"
                        android:text="我的游戏单"
                        android:textColor="@color/text_title"
                        android:textSize="@dimen/little_secondary_size"
                        app:drawableTopCompat="@drawable/ic_personal_my_game_collection" />

                    <TextView
                        android:id="@+id/historyTv"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:drawablePadding="2dp"
                        android:gravity="center"
                        android:includeFontPadding="false"
                        android:text="浏览记录"
                        android:textColor="@color/text_title"
                        android:textSize="@dimen/little_secondary_size"
                        app:drawableTopCompat="@drawable/ic_personal_history" />

                    <TextView
                        android:id="@+id/myCollectionTv"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:drawablePadding="2dp"
                        android:gravity="center"
                        android:includeFontPadding="false"
                        android:text="我的收藏"
                        android:textColor="@color/text_title"
                        android:textSize="@dimen/little_secondary_size"
                        app:drawableTopCompat="@drawable/ic_personal_my_collection" />
                </LinearLayout>

                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/recommendRv"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="12dp"
                    android:background="@drawable/bg_shape_white_radius_8"
                    android:overScrollMode="never"
                    android:visibility="gone"
                    tools:visibility="visible" />

                <FrameLayout
                    android:id="@+id/bannerContainer"
                    android:layout_width="match_parent"
                    android:layout_height="72dp"
                    android:layout_marginTop="12dp"
                    android:visibility="gone"
                    tools:visibility="visible">

                    <com.gh.common.view.InterceptVerticalScrollCardView
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        app:cardCornerRadius="8dp"
                        app:cardElevation="0dp">

                        <androidx.recyclerview.widget.RecyclerView
                            android:id="@+id/bannerRv"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:overScrollMode="never" />
                    </com.gh.common.view.InterceptVerticalScrollCardView>

                    <com.gh.gamecenter.common.view.ScaleIndicatorView
                        android:id="@+id/bannerIndicator"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="end|bottom"
                        android:layout_marginEnd="8dp"
                        android:layout_marginBottom="8dp"
                        app:checkedColor="@color/white"
                        app:checkedSliderWidth="12dp"
                        app:normalColor="@color/white_alpha_40"
                        app:normalSliderWidth="4dp"
                        app:sliderGap="4dp"
                        app:sliderHeight="4dp" />
                </FrameLayout>

                <LinearLayout
                    android:id="@+id/functionContainer"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="12dp"
                    android:background="@drawable/bg_shape_white_radius_8"
                    android:orientation="vertical"
                    android:paddingTop="16dp"
                    android:paddingBottom="24dp"
                    android:visibility="gone"
                    tools:visibility="visible">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="16dp"
                        android:text="更多功能"
                        android:textColor="@color/text_title"
                        android:textSize="@dimen/primary_text_size"
                        android:textStyle="bold" />

                    <androidx.recyclerview.widget.RecyclerView
                        android:id="@+id/funcRv"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="4dp"
                        android:layout_marginTop="14dp"
                        android:layout_marginEnd="4dp" />
                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="12dp"
                    android:background="@drawable/bg_shape_white_radius_8"
                    android:orientation="vertical"
                    android:paddingTop="4dp"
                    android:paddingBottom="4dp">

                    <include
                        android:id="@+id/settingItem"
                        layout="@layout/layout_personal_other_item"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content" />

                    <include
                        android:id="@+id/feedbackItem"
                        layout="@layout/layout_personal_other_item"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content" />

                    <include
                        android:id="@+id/shareGhItem"
                        layout="@layout/layout_personal_other_item"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content" />

                    <include
                        android:id="@+id/userProtocolItem"
                        layout="@layout/layout_personal_other_item"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content" />

                    <include
                        android:id="@+id/privacyPolicyItem"
                        layout="@layout/layout_personal_other_item"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content" />

                    <include
                        android:id="@+id/infoListItem"
                        layout="@layout/layout_personal_other_item"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content" />

                    <include
                        android:id="@+id/sdkListItem"
                        layout="@layout/layout_personal_other_item"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content" />

                    <include
                        android:id="@+id/permissionAndUsageItem"
                        layout="@layout/layout_personal_other_item"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content" />

                    <include
                        android:id="@+id/childrenPolicyItem"
                        layout="@layout/layout_personal_other_item"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content" />
                </LinearLayout>
            </LinearLayout>
        </androidx.core.widget.NestedScrollView>
    </androidx.coordinatorlayout.widget.CoordinatorLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>