<?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_parttime.mvvm.PartTimeHomeViewModel" />

        <variable
            name="click"
            type="com.hongyegroup.cpt_parttime.ui.main.PartTimeHomeFragment.ClickProxy" />

        <import type="android.text.TextUtils" />

    </data>

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

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

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="@dimen/d_46dp"
            android:gravity="center_vertical"
            android:orientation="horizontal"
            android:paddingLeft="@dimen/d_15dp"
            android:paddingRight="@dimen/d_15dp">

            <ImageButton
                binding:clicks="@{click.backPage}"
                android:layout_marginTop="1.5dp"
                style="@style/SelectableItemBackgroundLess"
                android:theme="@style/RippleWhite"
                android:src="@mipmap/iv_blue_back"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"/>

            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="32dp"
                android:layout_marginLeft="@dimen/d_15dp"
                android:layout_weight="1"
                android:background="@drawable/shape_search_gray_bg_corners3"
                android:gravity="center_vertical"
                android:orientation="horizontal">

                <ImageView
                    android:layout_width="@dimen/d_16dp"
                    android:layout_height="@dimen/d_16dp"
                    android:layout_marginLeft="@dimen/d_12dp"
                    android:src="@drawable/search_icon"
                    binding:clicks="@{click.doSearch}" />

                <EditText
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="@dimen/d_12dp"
                    android:layout_weight="1"
                    android:background="@color/transparent"
                    android:hint="大家都在搜"
                    android:imeOptions="actionSearch"
                    android:singleLine="true"
                    android:text="@={viewModel.mKeywordLiveData}"
                    android:textColor="@color/black"
                    android:textColorHint="@color/gray_99"
                    android:textSize="@dimen/d_14sp"
                    binding:onKeyEnter="@{click.doSearch}"
                    binding:typefaceMedium="@{true}" />

                <ImageView
                    android:layout_width="@dimen/d_16dp"
                    android:layout_height="@dimen/d_16dp"
                    android:layout_marginRight="@dimen/d_10dp"
                    android:src="@drawable/search_delete"
                    android:visibility="gone"
                    binding:clicks="@{click.searchDel}"
                    binding:isVisibleGone="@{!TextUtils.isEmpty(viewModel.MKeywordLiveData)}" />

            </LinearLayout>

            <com.guadou.lib_baselib.font_text_view.TextViewRegular
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="@dimen/d_12dp"
                android:text="重置"
                android:textColor="@color/app_blue"
                android:textSize="@dimen/d_15sp"
                binding:clicks="@{click.searchReset}" />

        </LinearLayout>

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

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:paddingTop="@dimen/d_8dp"
            android:paddingBottom="@dimen/d_10dp">

            <com.guadou.lib_baselib.font_text_view.TextViewRegular
                android:id="@+id/tv_filter_industry"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@{click.filterIndustryFlow? @drawable/shape_blue_round5 : @drawable/shape_white_round5}"
                android:drawableLeft="@drawable/industry_black"
                android:drawablePadding="@dimen/d_8dp"
                android:paddingLeft="@dimen/d_21dp"
                android:paddingTop="@dimen/d_8dp"
                android:paddingRight="@dimen/d_24dp"
                android:paddingBottom="@dimen/d_9dp"
                android:text="行业"
                android:textColor="@{click.filterIndustryFlow ? @color/white : @color/black}"
                android:textSize="@dimen/d_16sp"
                app:drawableTint="@color/selector_filter_industry"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintRight_toLeftOf="@id/tv_filter_date"
                app:layout_constraintTop_toTopOf="parent"
                binding:clicks="@{click.filterIndustry}"
                binding:setSelected="@{click.filterIndustryFlow}" />

            <com.guadou.lib_baselib.font_text_view.TextViewRegular
                android:id="@+id/tv_filter_date"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@{click.filterDateFlow ? @drawable/shape_blue_round5 : @drawable/shape_white_round5}"
                android:drawableLeft="@drawable/date_black"
                android:drawablePadding="@dimen/d_9dp"
                android:paddingLeft="@dimen/d_21dp"
                android:paddingTop="@dimen/d_8dp"
                android:paddingRight="@dimen/d_24dp"
                android:paddingBottom="@dimen/d_9dp"
                android:text="日期"
                android:textColor="@{click.filterDateFlow? @color/white : @color/black}"
                android:textSize="@dimen/d_16sp"
                app:drawableTint="@color/selector_filter_date"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintLeft_toRightOf="@id/tv_filter_industry"
                app:layout_constraintRight_toLeftOf="@id/tv_filter_option"
                app:layout_constraintTop_toTopOf="parent"
                binding:clicks="@{click.filterDate}"
                binding:setSelected="@{click.filterDateFlow}" />

            <com.guadou.lib_baselib.font_text_view.TextViewRegular
                android:id="@+id/tv_filter_option"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@{click.filterOptionFlow ? @drawable/shape_blue_round5 : @drawable/shape_white_round5}"
                android:drawableLeft="@drawable/part_filterby_white"
                android:drawablePadding="@dimen/d_10dp"
                android:paddingLeft="@dimen/d_21dp"
                android:paddingTop="@dimen/d_8dp"
                android:paddingRight="@dimen/d_24dp"
                android:paddingBottom="@dimen/d_9dp"
                android:text="筛选"
                android:textColor="@{click.filterOptionFlow ? @color/white : @color/black}"
                android:textSize="@dimen/d_16sp"
                app:drawableTint="@color/selector_filter_option"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintLeft_toRightOf="@id/tv_filter_date"
                app:layout_constraintRight_toRightOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                binding:clicks="@{click.filterOption}"
                binding:setSelected="@{click.filterOptionFlow}" />

        </androidx.constraintlayout.widget.ConstraintLayout>

        <View
            android:layout_width="match_parent"
            android:layout_height="@dimen/d_0.5dp"
            android:background="@color/divider_color_ee" />

        <!--   刷新+列表   -->
        <com.scwang.smart.refresh.layout.SmartRefreshLayout
            android:id="@+id/refresh_layout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:focusable="true"
            android:focusableInTouchMode="true"
            app:srlEnablePreviewInEditMode="true"
            app:srlPrimaryColor="@color/white"
            tools:visibility="gone">

            <com.scwang.smart.refresh.header.ClassicsHeader
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

            <androidx.coordinatorlayout.widget.CoordinatorLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent">

                <!--    顶部的新工作     -->
                <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/page_bg_f4"
                    app:elevation="0dp">

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="166dp"
                        android:orientation="horizontal"
                        app:layout_scrollFlags="scroll">

                        <androidx.recyclerview.widget.RecyclerView
                            android:id="@+id/rv_new_job"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:overScrollMode="never"
                            android:scrollbars="none" />

                    </LinearLayout>

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

                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/rv_all_job"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:overScrollMode="never"
                    android:scrollbars="vertical"
                    app:layout_behavior="@string/appbar_scrolling_view_behavior">

                </androidx.recyclerview.widget.RecyclerView>

            </androidx.coordinatorlayout.widget.CoordinatorLayout>

        </com.scwang.smart.refresh.layout.SmartRefreshLayout>

    </LinearLayout>

</layout>
