<?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_main.mvvm.MainViewModel" />

        <variable
            name="click"
            type="com.hongyegroup.cpt_main.ui.MainActivity.ClickProxy" />

    </data>

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

        <FrameLayout
            android:id="@+id/main_fragment_container"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />

        <View
            android:layout_width="match_parent"
            android:layout_height="@dimen/d_0.7dp"
            android:layout_gravity="bottom"
            android:background="@color/divider_color" />

        <!-- 底部的Tab -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/white"
            android:gravity="center_vertical"
            android:orientation="horizontal"
            android:paddingTop="@dimen/d_3dp"
            android:paddingBottom="@dimen/d_3dp">

            <!--首页-->
            <androidx.constraintlayout.widget.ConstraintLayout
                android:id="@+id/group_tab_home"
                style="@style/SelectableItemBackgroundLess"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:onClick="@{() -> click.switchHome()}">

                <ImageView
                    android:id="@+id/iv_home_text"
                    android:layout_width="@dimen/d_30dp"
                    android:layout_height="@dimen/d_30dp"
                    android:src="@drawable/selector_main_tab_home"
                    app:layout_constraintBottom_toTopOf="@+id/tv_home_text"
                    app:layout_constraintLeft_toLeftOf="parent"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintVertical_chainStyle="packed" />

                <com.guadou.lib_baselib.font_text_view.TextViewMedium
                    android:id="@+id/tv_home_text"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="首页"
                    android:textColor="@color/selector_tab_main_text"
                    android:textSize="@dimen/d_12sp"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintLeft_toLeftOf="parent"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/iv_home_text" />

                <com.guadou.lib_baselib.font_text_view.TextViewRegular
                    android:id="@+id/tv_home_unread_num"
                    android:layout_width="@dimen/d_15dp"
                    android:layout_height="@dimen/d_15dp"
                    android:layout_marginLeft="@dimen/d_30dp"
                    android:background="@drawable/shape_circle_red"
                    android:gravity="center"
                    android:text="2"
                    android:textColor="@color/white"
                    android:textSize="@dimen/d_8sp"
                    android:visibility="gone"
                    app:layout_constraintLeft_toLeftOf="parent"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toTopOf="parent" />

            </androidx.constraintlayout.widget.ConstraintLayout>

            <!--钱包-->
            <LinearLayout
                android:id="@+id/group_tab_wallet"
                style="@style/SelectableItemBackgroundLess"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:gravity="center"
                android:onClick="@{() -> click.switchEWallet()}"
                android:orientation="vertical">

                <ImageView
                    android:layout_width="@dimen/d_30dp"
                    android:layout_height="@dimen/d_30dp"
                    android:src="@drawable/selector_main_tab_wallet" />

                <com.guadou.lib_baselib.font_text_view.TextViewMedium
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="钱包"
                    android:textColor="@color/selector_tab_main_text"
                    android:textSize="@dimen/d_12sp" />

            </LinearLayout>

            <!-- 朋友圈 -->
            <androidx.constraintlayout.widget.ConstraintLayout
                android:id="@+id/group_tab_newsfeed"
                style="@style/SelectableItemBackgroundLess"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:onClick="@{() -> click.switchNewsFeed()}">

                <ImageView
                    android:id="@+id/iv_newsfeed_text"
                    android:layout_width="@dimen/d_30dp"
                    android:layout_height="@dimen/d_30dp"
                    android:src="@drawable/selector_main_tab_newsfeed"
                    app:layout_constraintBottom_toTopOf="@+id/tv_newsfeed_text"
                    app:layout_constraintLeft_toLeftOf="parent"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintVertical_chainStyle="packed" />

                <com.guadou.lib_baselib.font_text_view.TextViewMedium
                    android:id="@+id/tv_newsfeed_text"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="朋友圈"
                    android:textColor="@color/selector_tab_main_text"
                    android:textSize="@dimen/d_12sp"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintLeft_toLeftOf="parent"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/iv_newsfeed_text" />

                <com.guadou.lib_baselib.font_text_view.TextViewRegular
                    android:id="@+id/tv_newsfeed_unread_num"
                    android:layout_width="@dimen/d_8dp"
                    android:layout_height="@dimen/d_8dp"
                    android:layout_marginLeft="@dimen/d_30dp"
                    android:background="@drawable/shape_circle_red"
                    android:gravity="center"
                    android:textColor="@color/white"
                    android:visibility="gone"
                    app:layout_constraintLeft_toLeftOf="parent"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toTopOf="parent" />

            </androidx.constraintlayout.widget.ConstraintLayout>

            <!-- 我的  -->
            <androidx.constraintlayout.widget.ConstraintLayout
                android:id="@+id/group_tab_me"
                style="@style/SelectableItemBackgroundLess"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:onClick="@{() -> click.switchProfile()}">

                <ImageView
                    android:id="@+id/iv_me_text"
                    android:layout_width="@dimen/d_30dp"
                    android:layout_height="@dimen/d_30dp"
                    android:src="@drawable/selector_main_tab_me"
                    app:layout_constraintBottom_toTopOf="@+id/tv_me_text"
                    app:layout_constraintLeft_toLeftOf="parent"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintVertical_chainStyle="packed" />

                <com.guadou.lib_baselib.font_text_view.TextViewMedium
                    android:id="@+id/tv_me_text"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="我的"
                    android:textColor="@color/selector_tab_main_text"
                    android:textSize="@dimen/d_12sp"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintLeft_toLeftOf="parent"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/iv_me_text" />

                <com.guadou.lib_baselib.font_text_view.TextViewRegular
                    android:id="@+id/tv_me_unread_num"
                    android:layout_width="@dimen/d_15dp"
                    android:layout_height="@dimen/d_15dp"
                    android:layout_marginLeft="@dimen/d_30dp"
                    android:background="@drawable/shape_circle_red"
                    android:gravity="center"
                    android:text="2"
                    android:textColor="@color/white"
                    android:textSize="@dimen/d_8sp"
                    android:visibility="gone"
                    app:layout_constraintLeft_toLeftOf="parent"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toTopOf="parent" />

            </androidx.constraintlayout.widget.ConstraintLayout>

        </LinearLayout>

    </LinearLayout>

</layout>
