<?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.PartTimeJobDetailViewModel" />

        <variable
            name="click"
            type="com.hongyegroup.cpt_parttime.ui.activity.PartTimeJobDetailActivity.ClickProxy" />

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

    </data>


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <com.scwang.smart.refresh.layout.SmartRefreshLayout
            android:id="@+id/refresh_layout"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:focusable="true"
            android:focusableInTouchMode="true"
            app:srlEnablePreviewInEditMode="false"
            app:srlPrimaryColor="@color/white">

            <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/white"
                    android:orientation="vertical"
                    app:elevation="0dp">

                    <!--   顶部的图片    -->
                    <androidx.constraintlayout.widget.ConstraintLayout
                        android:id="@+id/cl_img_box"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        app:layout_scrollFlags="scroll|snap">

                        <ImageView
                            android:id="@+id/iv_job_photo_cover"
                            android:layout_width="0dp"
                            android:layout_height="0dp"
                            android:scaleType="centerCrop"
                            app:layout_constraintDimensionRatio="W,437:750"
                            app:layout_constraintLeft_toLeftOf="parent"
                            app:layout_constraintRight_toRightOf="parent"
                            app:layout_constraintTop_toTopOf="parent" />

                        <ProgressBar
                            android:id="@+id/progress_bar_job_img"
                            android:layout_width="25dp"
                            android:layout_height="25dp"
                            android:layout_gravity="center"
                            android:indeterminate="true"
                            android:indeterminateTint="@color/colorAccent"
                            android:indeterminateTintMode="src_atop"
                            app:layout_constraintBottom_toBottomOf="parent"
                            app:layout_constraintLeft_toLeftOf="parent"
                            app:layout_constraintRight_toRightOf="parent"
                            app:layout_constraintTop_toTopOf="parent" />

                        <com.youth.banner.Banner
                            android:id="@+id/banner_employer_imgs"
                            android:layout_width="match_parent"
                            android:layout_height="0dp"
                            android:background="@drawable/placeholder_img_banner"

                            app:banner_auto_loop="false"
                            app:banner_indicator_height="@dimen/d_5dp"
                            app:banner_indicator_marginBottom="@dimen/d_15dp"
                            app:banner_indicator_normal_color="#66ffffff"
                            app:banner_indicator_normal_width="@dimen/d_4dp"
                            app:banner_indicator_selected_color="#ffffff"
                            app:banner_indicator_selected_width="@dimen/d_6dp"
                            app:banner_indicator_space="@dimen/d_4dp"
                            app:banner_infinite_loop="true"

                            app:layout_constraintDimensionRatio="W,437:750"
                            app:layout_constraintLeft_toLeftOf="parent"
                            app:layout_constraintRight_toRightOf="parent"
                            app:layout_constraintTop_toTopOf="parent" />

                        <LinearLayout
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginRight="@dimen/d_15dp"
                            android:layout_marginBottom="@dimen/d_10dp"
                            android:background="@drawable/shape_job_detail_gallery_box"
                            android:gravity="center"
                            android:orientation="horizontal"
                            app:layout_constraintBottom_toBottomOf="parent"
                            app:layout_constraintRight_toRightOf="parent"
                            binding:clicks="@{click.gotoGalleryPage}">

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:drawableLeft="@drawable/job_detail_gallery_icon"
                                android:drawablePadding="@dimen/d_7dp"
                                android:paddingLeft="@dimen/d_10dp"
                                android:paddingTop="@dimen/d_6dp"
                                android:paddingRight="@dimen/d_10dp"
                                android:paddingBottom="@dimen/d_6dp"
                                android:text="@{viewModel.testText}"
                                android:textColor="@color/white"
                                android:textSize="@dimen/d_14sp" />

                        </LinearLayout>

                    </androidx.constraintlayout.widget.ConstraintLayout>

                    <!--   Tab布局   -->
                    <FrameLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content">

                        <com.google.android.material.tabs.TabLayout
                            android:id="@+id/tabLayout"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:background="@color/white"
                            app:tabIndicator="@drawable/shape_blue_bottom_line_3conner"
                            app:tabIndicatorColor="@color/app_blue"
                            app:tabIndicatorFullWidth="false"
                            app:tabIndicatorHeight="@dimen/d_2dp"
                            app:tabMode="scrollable"
                            app:tabRippleColor="@color/transparent"
                            app:tabSelectedTextColor="@color/app_blue"
                            app:tabTextColor="@color/black" />

                        <ImageView
                            android:id="@+id/iv_tab_right"
                            android:layout_width="wrap_content"
                            android:layout_height="match_parent"
                            android:layout_gravity="right"
                            android:src="@drawable/job_detail_tab_right_arrow"
                            binding:clicks="@{click.tabNext}" />

                    </FrameLayout>

                    <View
                        android:layout_width="match_parent"
                        android:layout_height="@dimen/d_6dp"
                        android:background="@color/page_bg" />

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

                <androidx.viewpager2.widget.ViewPager2
                    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>

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

        <!-- 底部按钮组容器 -->
        <FrameLayout
            android:id="@+id/fl_bottom_btns"
            android:layout_width="match_parent"
            android:layout_height="@dimen/d_48dp"
            android:orientation="vertical">

            <!-- 分享与申请/取消  -->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="horizontal">

                <LinearLayout
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_weight="1"
                    android:background="@color/part_share_btn_bg"
                    android:gravity="center"
                    android:orientation="horizontal"
                    binding:clicks="@{click.shareJob}">

                    <ImageView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:src="@drawable/part_share_icon" />

                    <com.guadou.lib_baselib.font_text_view.TextViewRegular
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="@dimen/d_10dp"
                        android:gravity="center"
                        android:text="分享"
                        android:textColor="@color/profile_red"
                        android:textSize="@dimen/d_17sp" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_weight="2"
                    android:background="@color/profile_red"
                    android:gravity="center"
                    android:orientation="horizontal"
                    binding:clicks="@{click.applyJob}">

                    <ImageView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:src="@drawable/part_apply_icon" />

                    <com.guadou.lib_baselib.font_text_view.TextViewRegular
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="@dimen/d_10dp"
                        android:gravity="center"
                        android:text="立即申请"
                        android:textColor="@color/white"
                        android:textSize="@dimen/d_17sp" />

                </LinearLayout>

            </LinearLayout>

        </FrameLayout>

    </LinearLayout>

</layout>