<?xml version="1.0" encoding="utf-8"?>
<com.scwang.smartrefresh.layout.SmartRefreshLayout 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/refresh"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/white"
    tools:context="com.sheep.gamegroup.view.activity.ActUserAppHome">

    <android.support.v4.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="fill_vertical"
        android:fillViewport="true"
        android:scrollbars="none"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

        <android.support.constraint.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:focusable="true"
            android:focusableInTouchMode="true">


            <ImageView
                android:id="@+id/user_app_home_bg"
                android:layout_width="match_parent"
                android:layout_height="160dp"
                android:scaleType="centerCrop"
                android:src="@drawable/icon"
                app:layout_constraintTop_toTopOf="parent" />

            <ImageView
                android:layout_width="?attr/actionBarSize"
                android:layout_height="?attr/actionBarSize"
                android:layout_marginTop="@dimen/status_bar_height"
                android:gravity="center_vertical"
                android:onClick="onClickBackImg"
                android:scaleType="centerInside"
                android:src="@drawable/narrow_back_white"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <ImageView
                android:layout_width="?attr/actionBarSize"
                android:layout_height="?attr/actionBarSize"
                android:layout_alignParentEnd="true"
                android:layout_marginTop="@dimen/status_bar_height"
                android:gravity="center_vertical"
                android:onClick="onClickShareImg"
                android:scaleType="centerInside"
                android:src="@drawable/ic_but_share_white"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <LinearLayout
                android:id="@+id/user_app_home_num_like_ll"
                android:layout_width="45dp"
                android:layout_height="45dp"
                android:background="#99FD2D54"
                android:gravity="center"
                android:orientation="vertical"
                android:onClick="onClickLike"
                app:layout_constraintBottom_toBottomOf="@id/user_app_home_bg"
                app:layout_constraintEnd_toEndOf="parent">

                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="16dp"
                    android:src="@mipmap/ic_like_white" />

                <TextView
                    android:id="@+id/user_app_home_num_like"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="2dp"
                    android:gravity="center"
                    android:text="@string/x"
                    android:textColor="@color/white"
                    android:textSize="12sp" />
            </LinearLayout>
            <!--不透明度40%-->
            <LinearLayout
                android:id="@+id/user_app_home_focus_ll"
                android:layout_width="45dp"
                android:layout_height="45dp"
                android:background="#99CCCCCC"
                android:gravity="center"
                android:onClick="onClickFocus"
                android:orientation="vertical"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="@id/user_app_home_num_like_ll"
                app:layout_constraintTop_toBottomOf="@id/user_app_home_bg">

                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="16dp"
                    android:src="@mipmap/ic_focus_red" />

                <TextView
                    android:id="@+id/user_app_home_focus"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="2dp"
                    android:gravity="center"
                    android:text="@string/focus"
                    android:textColor="#F7778F"
                    android:textSize="12sp" />
            </LinearLayout>
            <!--添加user_app_home_line, 只是为了让它下面的布局与 user_app_home_bg 的底部对齐-->
            <View
                android:id="@+id/user_app_home_line"
                android:layout_width="match_parent"
                android:layout_height="1px"
                app:layout_constraintBottom_toBottomOf="@id/user_app_home_bg" />

            <ImageView
                android:id="@+id/user_app_home_avatar"
                android:layout_width="60dp"
                android:layout_height="60dp"
                android:layout_marginBottom="8dp"
                android:src="@drawable/icon"
                app:layout_constraintBottom_toBottomOf="@id/user_app_home_line"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="@id/user_app_home_line" />

            <TextView
                android:id="@+id/user_app_home_name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:text="栗子的菜"
                android:textColor="#ff333333"
                android:textSize="13sp"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/user_app_home_avatar" />

            <LinearLayout
                android:id="@+id/user_app_home_ll"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="20dp"
                android:gravity="center_vertical"
                android:orientation="horizontal"
                android:paddingStart="10dp"
                android:paddingEnd="10dp"
                app:layout_constraintTop_toBottomOf="@id/user_app_home_name">

                <LinearLayout
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:gravity="center_horizontal"
                    android:orientation="vertical">

                    <TextView
                        android:id="@+id/user_app_home_num_fans"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:gravity="center"
                        android:text="@string/x"
                        android:textColor="#ff333333"
                        android:textSize="15sp" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="10dp"
                        android:gravity="center"
                        android:text="@string/my_fans"
                        android:textColor="#999999"
                        android:textSize="13sp" />
                </LinearLayout>

                <View
                    android:layout_width="1dp"
                    android:layout_height="15dp"
                    android:background="#f5f5f5" />

                <LinearLayout
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:gravity="center_horizontal"
                    android:orientation="vertical">

                    <TextView
                        android:id="@+id/user_app_home_num_focus_users"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:gravity="center"
                        android:text="@string/x"
                        android:textColor="#ff333333"
                        android:textSize="15sp" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="10dp"
                        android:gravity="center"
                        android:text="@string/focus_users"
                        android:textColor="#999999"
                        android:textSize="13sp" />
                </LinearLayout>

                <View
                    android:layout_width="1dp"
                    android:layout_height="15dp"
                    android:background="#f5f5f5" />

                <LinearLayout
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:gravity="center_horizontal"
                    android:orientation="vertical">

                    <TextView
                        android:id="@+id/user_app_home_num_focus_games"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:gravity="center"
                        android:text="@string/x"
                        android:textColor="#ff333333"
                        android:textSize="15sp" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="10dp"
                        android:gravity="center"
                        android:text="@string/focus_games"
                        android:textColor="#999999"
                        android:textSize="13sp" />
                </LinearLayout>
            </LinearLayout>


            <android.support.v7.widget.RecyclerView
                android:id="@+id/user_app_home_game_list"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:layout_constraintTop_toBottomOf="@id/user_app_home_ll" />

            <android.support.design.widget.TabLayout
                android:id="@+id/tabLayout"
                style="@style/style_tab"
                android:layout_height="48dp"
                app:layout_constraintTop_toBottomOf="@id/user_app_home_game_list"
                app:tabIndicatorHeight="2dp" />

            <include
                layout="@layout/line_1px_hor"
                app:layout_constraintTop_toBottomOf="@id/tabLayout" />


            <com.kfzs.android.view.widget.WrapContentHeightViewPager
                android:id="@+id/viewPager"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginTop="@dimen/content_padding_15"
                android:minHeight="@dimen/view_size_100"
                app:layout_behavior="@string/appbar_scrolling_view_behavior"
                app:layout_constraintTop_toBottomOf="@id/tabLayout" />

        </android.support.constraint.ConstraintLayout>
    </android.support.v4.widget.NestedScrollView>

</com.scwang.smartrefresh.layout.SmartRefreshLayout>