<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:binding="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    tools:ignore="RtlHardcoded">

    <data>

        <variable
            name="viewModel"
            type="com.hongyegroup.cpt_newsfeed.mvvm.NewsFeedMainViewModel" />

        <variable
            name="click"
            type="com.hongyegroup.cpt_newsfeed.ui.NewsFeedMainFragment.ClickProxy" />

    </data>


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/white"
        android:orientation="vertical">

        <com.guadou.lib_baselib.view.titlebar.StatusbarGrayView
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="@dimen/d_46dp"
            android:paddingLeft="@dimen/d_40dp"
            android:paddingRight="@dimen/d_40dp">

            <com.guadou.lib_baselib.font_text_view.TextViewBold
                android:id="@+id/text_moments"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:onClick="@{()->click.switchMoments()}"
                android:text="朋友圈"
                android:textColor="@color/gray_88"
                android:textSize="@dimen/d_16sp"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintRight_toLeftOf="@id/text_following"
                app:layout_constraintTop_toTopOf="parent" />

            <View
                android:id="@+id/view_follow_line"
                android:layout_width="0dp"
                android:layout_height="2.5dp"
                android:background="@drawable/shape_blue_round3"
                android:visibility="gone"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintLeft_toLeftOf="@id/text_moments"
                app:layout_constraintRight_toRightOf="@id/text_moments" />

            <com.guadou.lib_baselib.font_text_view.TextViewBold
                android:id="@+id/text_following"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:onClick="@{()->click.switchFollowing()}"
                android:text="已关注"
                android:textColor="@color/app_blue"
                android:textSize="@dimen/d_16sp"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintLeft_toRightOf="@id/text_moments"
                app:layout_constraintRight_toLeftOf="@id/text_pulished"
                app:layout_constraintTop_toTopOf="parent" />

            <!--  已关注的数量    -->
            <com.guadou.lib_baselib.font_text_view.TextViewBold
                android:layout_width="18dp"
                android:layout_height="11.5dp"
                android:background="@drawable/unread_red_bg"
                android:gravity="center"
                android:text="9"
                android:textColor="@color/white"
                android:textSize="@dimen/d_9sp"
                app:layout_constraintBottom_toTopOf="@id/text_following"
                app:layout_constraintLeft_toRightOf="@id/text_following"
                app:layout_constraintRight_toRightOf="@id/text_following"
                app:layout_constraintTop_toTopOf="@id/text_following" />

            <View
                android:id="@+id/view_for_you_line"
                android:layout_width="0dp"
                android:layout_height="2.5dp"
                android:background="@drawable/shape_blue_round3"
                android:visibility="visible"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintLeft_toLeftOf="@id/text_following"
                app:layout_constraintRight_toRightOf="@id/text_following" />

            <com.guadou.lib_baselib.font_text_view.TextViewBold
                android:id="@+id/text_pulished"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:onClick="@{()->click.switchPulished()}"
                android:text="我的发布"
                android:textColor="@color/gray_88"
                android:textSize="@dimen/d_16sp"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintLeft_toRightOf="@id/text_following"
                app:layout_constraintRight_toRightOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <View
                android:id="@+id/view_published"
                android:layout_width="0dp"
                android:layout_height="2.5dp"
                android:background="@drawable/shape_blue_round3"
                android:visibility="gone"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintLeft_toLeftOf="@id/text_pulished"
                app:layout_constraintRight_toRightOf="@id/text_pulished" />

        </androidx.constraintlayout.widget.ConstraintLayout>

        <View
            android:layout_width="match_parent"
            android:layout_height="0.7dp"
            android:background="@color/divider_color" />

        <androidx.coordinatorlayout.widget.CoordinatorLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/page_bg">

            <com.google.android.material.appbar.AppBarLayout
                android:id="@+id/app_bar_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/white"
                app:elevation="0dp">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="68dp"
                    android:gravity="center_vertical"
                    android:orientation="horizontal"
                    app:layout_scrollFlags="scroll|snap|enterAlways"
                    binding:clicks="@{click.gotoPostPage}">

                    <com.guadou.lib_baselib.view.CircleImageView
                        android:id="@+id/iv_feed_avatar"
                        android:layout_width="@dimen/d_45dp"
                        android:layout_height="@dimen/d_45dp"
                        android:layout_marginLeft="@dimen/d_15dp"
                        android:scaleType="centerCrop"
                        android:src="@drawable/im_default_head" />

                    <com.guadou.lib_baselib.font_text_view.TextViewBold
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="@dimen/d_19dp"
                        android:layout_weight="1"
                        android:text="在想什么有趣的呢？"
                        android:textColor="@color/notify_dark_blue"
                        android:textSize="@dimen/d_16sp" />

                    <ImageView
                        android:id="@+id/iv_feed_take_photo"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginRight="@dimen/d_16dp"
                        android:src="@drawable/news_feed_camera" />

                </LinearLayout>

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

            <androidx.viewpager.widget.ViewPager
                android:id="@+id/view_pager"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:layout_behavior="@string/appbar_scrolling_view_behavior" />

        </androidx.coordinatorlayout.widget.CoordinatorLayout>

    </LinearLayout>

</layout>
