Forráskód Böngészése

Merge branch 'master' of http://git.wmzhubo.com/guadoutech/PartTimeJob_CN_Android

Administrator 2 éve
szülő
commit
c1228de755
34 módosított fájl, 512 hozzáadás és 371 törlés
  1. 13 27
      cpt_ewallet/src/main/res/layout/fragment_ewallet_main.xml
  2. 8 7
      cpt_ewallet/src/main/res/layout/item_ewallet_history.xml
  3. 4 0
      cpt_main/src/main/AndroidManifest.xml
  4. 2 2
      cpt_main/src/main/java/com/hongyegroup/cpt_main/mvvm/NotificationMainViewModel.kt
  5. 4 0
      cpt_main/src/main/java/com/hongyegroup/cpt_main/ui/HomeFragment.kt
  6. 3 6
      cpt_main/src/main/java/com/hongyegroup/cpt_main/ui/MainActivity.kt
  7. 25 27
      cpt_main/src/main/java/com/hongyegroup/cpt_main/ui/NotificationFragment.kt
  8. 8 8
      cpt_main/src/main/res/layout/activity_main.xml
  9. 7 36
      cpt_main/src/main/res/layout/fragment_notification_main.xml
  10. 8 8
      cpt_main/src/main/res/layout/fragment_home.xml
  11. 2 2
      cpt_main/src/main/res/layout/item_home_job_tips.xml
  12. 6 6
      cpt_main/src/main/res/layout/item_home_part_time_job.xml
  13. 3 4
      cpt_main/src/main/res/layout/item_notification.xml
  14. 0 1
      cpt_parttime/src/main/java/com/hongyegroup/cpt_parttime/adapter/PartTimeJobAdapter.kt
  15. 34 17
      cpt_parttime/src/main/java/com/hongyegroup/cpt_parttime/mvvm/PartTimeMainViewModel.kt
  16. 34 32
      cpt_parttime/src/main/java/com/hongyegroup/cpt_parttime/ui/PartTimeMainFragment.kt
  17. 11 0
      cpt_parttime/src/main/res/color/selector_filter_date.xml
  18. 11 0
      cpt_parttime/src/main/res/color/selector_filter_industry.xml
  19. 11 0
      cpt_parttime/src/main/res/color/selector_filter_option.xml
  20. BIN
      cpt_parttime/src/main/res/drawable-xhdpi/part_new_job_item_bg.webp
  21. BIN
      cpt_parttime/src/main/res/drawable-xxhdpi/date_black.webp
  22. BIN
      cpt_parttime/src/main/res/drawable-xxhdpi/industry_black.webp
  23. BIN
      cpt_parttime/src/main/res/drawable-xxhdpi/location_address_icon.webp
  24. BIN
      cpt_parttime/src/main/res/drawable-xxhdpi/part_filterby_white.png
  25. 112 171
      cpt_parttime/src/main/res/layout/fragment_parttime_main.xml
  26. 190 0
      cpt_parttime/src/main/res/layout/item_part_time_new_job.xml
  27. 1 0
      cs_baselib/src/main/res/values/colors.xml
  28. 1 1
      cs_baselib/src/main/res/values/styles.xml
  29. 5 0
      cs_cptServices/src/main/java/com/guadou/cs_cptservices/binding/BindingView.kt
  30. 0 0
      cs_cptServices/src/main/res/drawable-xhdpi/placeholder_img_job_img.webp
  31. 0 16
      cs_cptServices/src/main/res/drawable/selector_btn_white_gray_bg.xml
  32. 7 0
      cs_cptServices/src/main/res/drawable/selector_white_item_click_bg.xml
  33. 0 0
      cs_cptServices/src/main/res/drawable/selector_white_round10_item_click_bg.xml
  34. 2 0
      cs_cptServices/src/main/res/values/colors.xml

+ 13 - 27
cpt_ewallet/src/main/res/layout/fragment_ewallet_main.xml

@@ -74,18 +74,7 @@
                             app:layout_constraintRight_toRightOf="parent"
                             app:layout_constraintTop_toTopOf="parent" />
 
-                        <TextView
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:layout_marginTop="@dimen/d_10dp"
-                            android:layout_marginRight="@dimen/d_8dp"
-                            android:text=""
-                            android:textColor="@color/white"
-                            android:textSize="@dimen/d_12sp"
-                            app:layout_constraintRight_toLeftOf="@+id/tv_money"
-                            app:layout_constraintTop_toTopOf="@+id/tv_money" />
-
-                        <TextView
+                        <com.guadou.lib_baselib.font_text_view.TextViewMedium
                             android:id="@+id/tv_money"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
@@ -115,14 +104,14 @@
                             app:layout_constraintTop_toBottomOf="@+id/tv_money"
                             app:layout_constraintTop_toTopOf="@+id/ll_available">
 
-                            <TextView
+                            <com.guadou.lib_baselib.font_text_view.TextViewMedium
                                 android:layout_width="wrap_content"
                                 android:layout_height="wrap_content"
                                 android:text="提现金额:"
                                 android:textColor="@color/white"
                                 android:textSize="@dimen/d_13sp" />
 
-                            <TextView
+                            <com.guadou.lib_baselib.font_text_view.TextViewBold
                                 android:id="@+id/tv_giro"
                                 android:layout_width="wrap_content"
                                 android:layout_height="wrap_content"
@@ -151,14 +140,14 @@
                             app:layout_constraintRight_toRightOf="parent"
                             app:layout_constraintTop_toBottomOf="@+id/tv_money">
 
-                            <TextView
+                            <com.guadou.lib_baselib.font_text_view.TextViewMedium
                                 android:layout_width="wrap_content"
                                 android:layout_height="wrap_content"
                                 android:text="可用余额:"
                                 android:textColor="@color/white"
                                 android:textSize="@dimen/d_13sp" />
 
-                            <TextView
+                            <com.guadou.lib_baselib.font_text_view.TextViewBold
                                 android:id="@+id/tv_available"
                                 android:layout_width="wrap_content"
                                 android:layout_height="wrap_content"
@@ -171,7 +160,6 @@
 
                         </LinearLayout>
 
-
                         <ImageView
                             android:id="@+id/iv_bolang"
                             android:layout_width="match_parent"
@@ -202,7 +190,7 @@
                                 android:layout_height="@dimen/d_35dp"
                                 android:src="@drawable/wallet_withdrawn_icon" />
 
-                            <TextView
+                            <com.guadou.lib_baselib.font_text_view.TextViewMedium
                                 android:layout_width="wrap_content"
                                 android:layout_height="wrap_content"
                                 android:layout_marginTop="@dimen/d_5dp"
@@ -232,7 +220,7 @@
                                 android:layout_height="@dimen/d_35dp"
                                 android:src="@drawable/wallet_appointments_icon" />
 
-                            <TextView
+                            <com.guadou.lib_baselib.font_text_view.TextViewMedium
                                 android:layout_width="wrap_content"
                                 android:layout_height="wrap_content"
                                 android:layout_marginTop="@dimen/d_5dp"
@@ -265,14 +253,13 @@
                             android:layout_height="@dimen/d_26dp"
                             android:src="@drawable/wallet_password_icon" />
 
-                        <TextView
+                        <com.guadou.lib_baselib.font_text_view.TextViewMedium
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_marginLeft="@dimen/d_8dp"
                             android:text="支付密码设置"
                             android:textColor="@color/gray_76"
-                            android:textSize="@dimen/d_15sp"
-                            binding:typefaceRegular="@{true}" />
+                            android:textSize="@dimen/d_15sp" />
 
                         <View
                             android:layout_width="0dp"
@@ -308,14 +295,13 @@
                             android:layout_height="@dimen/d_25dp"
                             android:src="@drawable/wallet_history_icon" />
 
-                        <TextView
+                        <com.guadou.lib_baselib.font_text_view.TextViewMedium
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_marginLeft="@dimen/d_8dp"
                             android:text="电子钱包交易记录"
                             android:textColor="@color/gray_76"
-                            android:textSize="@dimen/d_15sp"
-                            binding:typefaceRegular="@{true}" />
+                            android:textSize="@dimen/d_15sp" />
 
                         <View
                             android:layout_width="0dp"
@@ -350,7 +336,7 @@
                             android:layout_height="@dimen/d_25dp"
                             android:src="@drawable/wallet_invoice_icon" />
 
-                        <TextView
+                        <com.guadou.lib_baselib.font_text_view.TextViewMedium
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_marginLeft="@dimen/d_8dp"
@@ -370,7 +356,7 @@
 
                     </LinearLayout>
 
-                    <TextView
+                    <com.guadou.lib_baselib.font_text_view.TextViewBold
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
                         android:layout_marginTop="@dimen/d_10dp"

+ 8 - 7
cpt_ewallet/src/main/res/layout/item_ewallet_history.xml

@@ -32,14 +32,14 @@
                 android:layout_marginLeft="@dimen/d_14dp"
                 android:layout_marginTop="@dimen/d_16dp"
                 android:scaleType="centerCrop"
-                android:src="@drawable/plachholder_img_job_img" />
+                android:src="@drawable/placeholder_img_job_img" />
 
-            <TextView
+            <com.guadou.lib_baselib.font_text_view.TextViewMedium
                 android:layout_width="0dp"
                 android:layout_height="wrap_content"
-                android:layout_marginLeft="@dimen/d_12dp"
+                android:layout_marginLeft="11dp"
                 android:layout_marginTop="@dimen/d_16dp"
-                android:layout_marginRight="@dimen/d_12dp"
+                android:layout_marginRight="14dp"
                 android:layout_toLeftOf="@id/tv_change"
                 android:layout_toRightOf="@id/iv_icon"
                 android:ellipsize="end"
@@ -49,7 +49,7 @@
                 android:textColor="@color/text_yellow_ff9300"
                 android:textSize="@dimen/d_17sp" />
 
-            <TextView
+            <com.guadou.lib_baselib.font_text_view.TextViewRegular
                 android:id="@+id/tv_time"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
@@ -61,7 +61,7 @@
                 android:textColor="@color/gray_76"
                 android:textSize="@dimen/d_13sp" />
 
-            <TextView
+            <com.guadou.lib_baselib.font_text_view.TextViewMedium
                 android:id="@+id/tv_change"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
@@ -70,7 +70,8 @@
                 android:layout_marginRight="@dimen/d_17dp"
                 android:text="+30.25"
                 android:textColor="@color/profile_red"
-                android:textSize="@dimen/d_24sp" />
+                android:textSize="@dimen/d_20sp" />
+
         </RelativeLayout>
 
 

+ 4 - 0
cpt_main/src/main/AndroidManifest.xml

@@ -8,6 +8,10 @@
             android:name=".ui.MainActivity"
             android:launchMode="singleTask" />
 
+        <activity
+            android:name=".ui.NotificationActivity"
+            android:launchMode="singleTop" />
+
     </application>
 
 </manifest>

+ 2 - 2
cpt_main/src/main/java/com/hongyegroup/cpt_main/mvvm/NotificationMainViewModel.kt

@@ -19,7 +19,7 @@ import kotlinx.coroutines.withContext
 import javax.inject.Inject
 
 @HiltViewModel
-class NotificationMainViewModel @Inject constructor(
+class NotificationViewModel @Inject constructor(
     private val savedStateHandle: SavedStateHandle
 ) : BaseViewModel() {
 
@@ -40,7 +40,7 @@ class NotificationMainViewModel @Inject constructor(
             //开始Loading
             if (isNeedPlaceHolder) loadStartLoading()
             val result = withContext(Dispatchers.IO) {
-                delay(1000)
+                delay(1500)
 
                 val list = mutableListOf<NotificationBean>()
                 for (i in 1..10) {

+ 4 - 0
cpt_main/src/main/java/com/hongyegroup/cpt_main/ui/HomeFragment.kt

@@ -147,6 +147,10 @@ class HomeFragment : YYBaseVDBLoadingFragment<HomeViewModel, FragmentHomeBinding
         fun gotoBulletinBoardPage() {
             toast("去公告板页面")
         }
+
+        fun gotoNotificationPage() {
+            NotificationActivity.startInstance()
+        }
     }
 
 

+ 3 - 6
cpt_main/src/main/java/com/hongyegroup/cpt_main/ui/MainActivity.kt

@@ -1,6 +1,5 @@
 package com.hongyegroup.cpt_main.ui
 
-import android.content.Intent
 import android.os.Bundle
 import androidx.fragment.app.Fragment
 import androidx.fragment.app.FragmentManager
@@ -11,7 +10,8 @@ import com.guadou.cs_cptservices.interfaces.IFragmentRefresh
 import com.guadou.cs_router.ARouterPath
 import com.guadou.cs_router.YYRouterService
 import com.guadou.lib_baselib.bean.DataBindingConfig
-import com.guadou.lib_baselib.utils.CommUtils
+import com.guadou.lib_baselib.ext.commContext
+import com.guadou.lib_baselib.ext.gotoActivity
 import com.guadou.lib_baselib.utils.NetWorkUtil
 import com.guadou.lib_baselib.utils.StatusBarUtils
 import com.hongyegroup.cpt_main.BR
@@ -38,10 +38,7 @@ class MainActivity : YYBaseVDBActivity<MainViewModel, ActivityMainBinding>() {
 
     companion object {
         fun startInstance() {
-            val context = CommUtils.getContext()
-            val intent = Intent(context, MainActivity::class.java)
-            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
-            context.startActivity(intent)
+            commContext().gotoActivity<MainActivity>()
         }
     }
 

+ 25 - 27
cpt_main/src/main/java/com/hongyegroup/cpt_main/ui/NotificationFragment.kt

@@ -1,45 +1,53 @@
 package com.hongyegroup.cpt_main.ui
 
 import android.os.Bundle
-import android.view.View
 import com.chad.library.adapter.base.listener.OnLoadMoreListener
-import com.guadou.cs_cptservices.base.fragment.YYBaseVDBLoadingFragment
+import com.guadou.cs_cptservices.base.activity.YYBaseVDBLoadingActivity
 import com.guadou.cs_cptservices.interfaces.IFragmentRefresh
 import com.guadou.lib_baselib.bean.DataBindingConfig
 import com.guadou.lib_baselib.engine.toast
+import com.guadou.lib_baselib.ext.commContext
+import com.guadou.lib_baselib.ext.gotoActivity
 import com.guadou.lib_baselib.ext.vertical
 import com.guadou.lib_baselib.view.gloading.GLoadingTitleStatus
 import com.guadou.lib_baselib.view.gloading.Gloading
-import com.guadou.lib_baselib.view.gloading.GloadingGlobalAdapter
+import com.guadou.lib_baselib.view.gloading.GloadingPlaceHolderlAdapter
 import com.hongyegroup.cpt_main.BR
 import com.hongyegroup.cpt_main.R
-import com.hongyegroup.cpt_main.databinding.FragmentNotificationMainBinding
-import com.hongyegroup.cpt_main.mvvm.NotificationMainViewModel
+import com.hongyegroup.cpt_main.databinding.ActivityNotificationBinding
+import com.hongyegroup.cpt_main.mvvm.NotificationViewModel
 import com.scwang.smart.refresh.layout.api.RefreshLayout
 import com.scwang.smart.refresh.layout.listener.OnRefreshListener
 
 /**
  * 通知列表
  */
-class NotificationFragment : YYBaseVDBLoadingFragment<NotificationMainViewModel, FragmentNotificationMainBinding>(), IFragmentRefresh,
+class NotificationActivity : YYBaseVDBLoadingActivity<NotificationViewModel, ActivityNotificationBinding>(), IFragmentRefresh,
     OnLoadMoreListener, OnRefreshListener {
 
+    companion object {
+        fun startInstance() {
+            commContext().gotoActivity<NotificationActivity>()
+        }
+    }
+
     override fun getDataBindingConfig(): DataBindingConfig {
-        return DataBindingConfig(R.layout.fragment_notification_main, BR.viewModel, mViewModel)
-            .addBindingParams(BR.click, ClickProxy())
+        return DataBindingConfig(R.layout.activity_notification, BR.viewModel, mViewModel)
     }
 
-    //重新生成GLoading对象-跳动动画
-    override fun generateGLoading(view: View): Gloading.Holder {
-        return Gloading.from(GloadingGlobalAdapter())
-            .wrap(view, GLoadingTitleStatus(true, true, true))
+    //重新生成GLoading对象
+    override fun generateGLoading(): Gloading.Holder {
+        return Gloading.from(GloadingPlaceHolderlAdapter(R.layout.layout_placeholder_normal))
+            .wrap(this, GLoadingTitleStatus(true, true, false))
             .withRetry { onGoadingRetry() }
     }
 
     override fun startObserve() {
+
     }
 
     override fun init(savedInstanceState: Bundle?) {
+        setStatusBarBlackText()
 
         initRV()
         initData()
@@ -59,6 +67,10 @@ class NotificationFragment : YYBaseVDBLoadingFragment<NotificationMainViewModel,
     }
 
     private fun initListener() {
+        mBinding.easyTitle.addRightText("全部已读") {
+            toast("全部已读消息")
+        }
+
         //Adapter的滑动监听,监听加载更多
         mViewModel.mAdapter.loadMoreModule.isEnableLoadMore = false
         mViewModel.mAdapter.loadMoreModule.preLoadNumber = 4
@@ -99,9 +111,7 @@ class NotificationFragment : YYBaseVDBLoadingFragment<NotificationMainViewModel,
     }
 
     private fun initRV() {
-        mBinding.recyclerView.vertical().apply {
-            adapter = mViewModel.mAdapter
-        }
+        mBinding.recyclerView.vertical().adapter = mViewModel.mAdapter
     }
 
     override fun scrollTopRefresh() {
@@ -111,17 +121,5 @@ class NotificationFragment : YYBaseVDBLoadingFragment<NotificationMainViewModel,
         mBinding.refreshLayout.autoRefresh()
     }
 
-    /**
-     * DataBinding事件处理
-     */
-    inner class ClickProxy {
-
-        //阅读全部
-        fun readAll() {
-            toast("阅读全部")
-        }
-
-    }
-
 
 }

+ 8 - 8
cpt_main/src/main/res/layout/activity_main.xml

@@ -65,7 +65,7 @@
                     app:layout_constraintTop_toTopOf="parent"
                     app:layout_constraintVertical_chainStyle="packed" />
 
-                <TextView
+                <com.guadou.lib_baselib.font_text_view.TextViewMedium
                     android:id="@+id/tv_home_text"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
@@ -78,7 +78,7 @@
                     app:layout_constraintRight_toRightOf="parent"
                     app:layout_constraintTop_toBottomOf="@+id/iv_home_text" />
 
-                <TextView
+                <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"
@@ -115,7 +115,7 @@
                     app:layout_constraintTop_toTopOf="parent"
                     app:layout_constraintVertical_chainStyle="packed" />
 
-                <TextView
+                <com.guadou.lib_baselib.font_text_view.TextViewMedium
                     android:id="@+id/tv_parttime_text"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
@@ -128,7 +128,7 @@
                     app:layout_constraintRight_toRightOf="parent"
                     app:layout_constraintTop_toBottomOf="@+id/iv_parttime_text" />
 
-                <TextView
+                <com.guadou.lib_baselib.font_text_view.TextViewRegular
                     android:id="@+id/tv_parttime_unread_num"
                     android:layout_width="@dimen/d_15dp"
                     android:layout_height="@dimen/d_15dp"
@@ -165,7 +165,7 @@
                     app:layout_constraintTop_toTopOf="parent"
                     app:layout_constraintVertical_chainStyle="packed" />
 
-                <TextView
+                <com.guadou.lib_baselib.font_text_view.TextViewMedium
                     android:id="@+id/tv_actives_text"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
@@ -178,7 +178,7 @@
                     app:layout_constraintRight_toRightOf="parent"
                     app:layout_constraintTop_toBottomOf="@+id/iv_actives_text" />
 
-                <TextView
+                <com.guadou.lib_baselib.font_text_view.TextViewRegular
                     android:id="@+id/tv_actives_unread_num"
                     android:layout_width="@dimen/d_8dp"
                     android:layout_height="@dimen/d_8dp"
@@ -239,7 +239,7 @@
                     app:layout_constraintTop_toTopOf="parent"
                     app:layout_constraintVertical_chainStyle="packed" />
 
-                <TextView
+                <com.guadou.lib_baselib.font_text_view.TextViewMedium
                     android:id="@+id/tv_me_text"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
@@ -252,7 +252,7 @@
                     app:layout_constraintRight_toRightOf="parent"
                     app:layout_constraintTop_toBottomOf="@+id/iv_me_text" />
 
-                <TextView
+                <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"

+ 7 - 36
cpt_main/src/main/res/layout/fragment_notification_main.xml

@@ -9,11 +9,7 @@
 
         <variable
             name="viewModel"
-            type="com.hongyegroup.cpt_main.mvvm.NotificationMainViewModel" />
-
-        <variable
-            name="click"
-            type="com.hongyegroup.cpt_main.ui.NotificationFragment.ClickProxy" />
+            type="com.hongyegroup.cpt_main.mvvm.NotificationViewModel" />
 
     </data>
 
@@ -23,38 +19,13 @@
         android:background="@color/white"
         android:orientation="vertical">
 
-        <com.guadou.lib_baselib.view.titlebar.StatusbarGrayView
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content" />
-
-        <FrameLayout
-            android:layout_width="match_parent"
-            android:layout_height="@dimen/d_46dp">
-
-            <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_gravity="center"
-                android:text="信息"
-                android:textColor="@color/black"
-                android:textSize="@dimen/d_18sp" />
-
-            <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_gravity="right|center_vertical"
-                android:layout_marginRight="@dimen/d_15dp"
-                android:text="全部已读"
-                android:textColor="@color/profile_red"
-                android:textSize="@dimen/d_16sp"
-                binding:clicks="@{click.readAll}" />
-
-        </FrameLayout>
-
-        <View
+        <com.guadou.lib_baselib.view.titlebar.EasyTitleBar
+            android:id="@+id/easy_title"
             android:layout_width="match_parent"
-            android:layout_height="@dimen/d_0.7dp"
-            android:background="@color/divider_color_ee" />
+            android:layout_height="wrap_content"
+            app:Easy_menuTextColor="@color/profile_red"
+            app:Easy_menuTextSize="@dimen/d_15sp"
+            app:Easy_title="消息列表" />
 
         <com.scwang.smart.refresh.layout.SmartRefreshLayout
             android:id="@+id/refresh_layout"

+ 8 - 8
cpt_main/src/main/res/layout/fragment_home.xml

@@ -51,6 +51,7 @@
                 android:layout_gravity="center"
                 android:layout_marginRight="@dimen/d_15dp"
                 android:contentDescription="通知列表"
+                binding:clicks="@{click.gotoNotificationPage}"
                 android:src="@drawable/main_title_notification_icon"
                 android:visibility="visible"
                 app:layout_constraintBottom_toBottomOf="parent"
@@ -144,7 +145,7 @@
                                 app:layout_constraintLeft_toRightOf="@id/icon_wallet"
                                 app:layout_constraintRight_toRightOf="@id/icon_wallet" />
 
-                            <TextView
+                            <com.guadou.lib_baselib.font_text_view.TextViewRegular
                                 android:id="@+id/tv_wallet_money"
                                 android:layout_width="wrap_content"
                                 android:layout_height="wrap_content"
@@ -191,8 +192,7 @@
                                 app:layout_constraintLeft_toLeftOf="parent"
                                 app:layout_constraintTop_toTopOf="parent" />
 
-
-                            <TextView
+                            <com.guadou.lib_baselib.font_text_view.TextViewRegular
                                 android:layout_width="wrap_content"
                                 android:layout_height="wrap_content"
                                 android:layout_marginLeft="@dimen/d_10dp"
@@ -249,7 +249,7 @@
 
 
                     <!-- 热门 -->
-                    <TextView
+                    <com.guadou.lib_baselib.font_text_view.TextViewMedium
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_marginLeft="@dimen/d_15dp"
@@ -271,7 +271,7 @@
                         android:overScrollMode="never" />
 
                     <!-- 当地市的工作 -->
-                    <TextView
+                    <com.guadou.lib_baselib.font_text_view.TextViewMedium
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_marginLeft="@dimen/d_15dp"
@@ -293,7 +293,7 @@
                         android:overScrollMode="never" />
 
                     <!-- 当地区域的工作 -->
-                    <TextView
+                    <com.guadou.lib_baselib.font_text_view.TextViewMedium
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_marginLeft="@dimen/d_15dp"
@@ -323,7 +323,7 @@
                         android:orientation="horizontal"
                         binding:clicks="@{click.gotoBulletinBoardPage}">
 
-                        <TextView
+                        <com.guadou.lib_baselib.font_text_view.TextViewMedium
                             android:layout_width="0dp"
                             android:layout_height="wrap_content"
                             android:layout_marginLeft="@dimen/d_15dp"
@@ -332,7 +332,7 @@
                             android:textColor="@color/black"
                             android:textSize="@dimen/d_17sp" />
 
-                        <TextView
+                        <com.guadou.lib_baselib.font_text_view.TextViewRegular
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_marginRight="@dimen/d_15dp"

+ 2 - 2
cpt_main/src/main/res/layout/item_home_job_tips.xml

@@ -36,7 +36,7 @@
             binding:placeholder="@{@drawable/placeholder_img_top_round_tips}"
             binding:topRoundRadius="@{5}" />
 
-        <TextView
+        <com.guadou.lib_baselib.font_text_view.TextViewMedium
             android:id="@+id/tv_content_title"
             android:layout_width="match_parent"
             android:layout_height="@dimen/d_40dp"
@@ -51,7 +51,7 @@
             android:textSize="@dimen/d_14sp" />
 
 
-        <TextView
+        <com.guadou.lib_baselib.font_text_view.TextViewRegular
             android:id="@+id/tv_sub_titme"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"

+ 6 - 6
cpt_main/src/main/res/layout/item_home_part_time_job.xml

@@ -39,7 +39,7 @@
                 binding:topRoundRadius="@{5}"
                 tools:src="@drawable/placeholder_img_top_round_job" />
 
-            <TextView
+            <com.guadou.lib_baselib.font_text_view.TextViewRegular
                 android:id="@+id/tv_job_tag"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
@@ -55,7 +55,7 @@
                 android:textSize="@dimen/d_12sp" />
         </FrameLayout>
 
-        <TextView
+        <com.guadou.lib_baselib.font_text_view.TextViewMedium
             android:id="@+id/tv_job_title"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
@@ -77,7 +77,7 @@
             android:gravity="center_vertical"
             android:orientation="horizontal">
 
-            <TextView
+            <com.guadou.lib_baselib.font_text_view.TextViewRegular
                 android:id="@+id/tv_job_hour_rate"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
@@ -85,7 +85,7 @@
                 android:textColor="@color/app_blue"
                 android:textSize="@dimen/d_15sp" />
 
-            <TextView
+            <com.guadou.lib_baselib.font_text_view.TextViewRegular
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:text="/时"
@@ -97,14 +97,14 @@
                 android:layout_height="1dp"
                 android:layout_weight="1" />
 
-            <TextView
+            <com.guadou.lib_baselib.font_text_view.TextViewRegular
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:text="总计"
                 android:textColor="@color/gray_76"
                 android:textSize="@dimen/d_13sp" />
 
-            <TextView
+            <com.guadou.lib_baselib.font_text_view.TextViewRegular
                 android:id="@+id/tv_job_est"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"

+ 3 - 4
cpt_main/src/main/res/layout/item_notification.xml

@@ -46,9 +46,9 @@
                     android:layout_height="wrap_content"
                     android:text="您的面试已获得兼职工作的批准。"
                     android:textColor="@color/notify_dark_blue"
-                    android:textSize="@dimen/d_18sp" />
+                    android:textSize="@dimen/d_17sp" />
 
-                <com.guadou.lib_baselib.font_text_view.TextViewMedium
+                <com.guadou.lib_baselib.font_text_view.TextViewRegular
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:layout_marginTop="@dimen/d_5dp"
@@ -68,12 +68,11 @@
                         android:layout_height="wrap_content"
                         android:src="@drawable/notify_date_icon" />
 
-                    <TextView
+                    <com.guadou.lib_baselib.font_text_view.TextViewRegular
                         android:layout_width="0dp"
                         android:layout_height="wrap_content"
                         android:layout_marginLeft="@dimen/d_9dp"
                         android:layout_weight="1"
-                        android:fontFamily="sans-serif-light"
                         android:text="2022.1.12 06:00"
                         android:textColor="@color/gray_76"
                         android:textSize="@dimen/d_14sp" />

+ 0 - 1
cpt_parttime/src/main/java/com/hongyegroup/cpt_parttime/adapter/PartTimeJobAdapter.kt

@@ -43,7 +43,6 @@ class PartTimeJobAdapter(br: Int, list: MutableList<PartJobResult>) :
         //不方便做DataBinding的操作 ↓
         if (holder.itemViewType == PartJobResult.TYPE_ITEM) {
 
-
         } else if (holder.itemViewType == PartJobResult.TYPE_BANNER) {
 
             val imageUrl = "http://i03piccdn.sogoucdn.com/dbbea331b73acd7d"

+ 34 - 17
cpt_parttime/src/main/java/com/hongyegroup/cpt_parttime/mvvm/PartTimeMainViewModel.kt

@@ -4,41 +4,59 @@ import android.annotation.SuppressLint
 import androidx.lifecycle.LiveData
 import androidx.lifecycle.MutableLiveData
 import androidx.lifecycle.SavedStateHandle
+import com.guadou.cs_cptservices.binding.BaseDataBindingAdapter
 import com.guadou.lib_baselib.base.vm.BaseViewModel
 import com.guadou.lib_baselib.ext.checkEmpty
 import com.hongyegroup.cpt_parttime.BR
+import com.hongyegroup.cpt_parttime.R
 import com.hongyegroup.cpt_parttime.adapter.PartTimeJobAdapter
 import com.hongyegroup.cpt_parttime.bean.PartJobResult
 import dagger.hilt.android.lifecycle.HiltViewModel
 import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.async
 import kotlinx.coroutines.delay
 import kotlinx.coroutines.withContext
 import javax.inject.Inject
 
+@SuppressLint("NotifyDataSetChanged")
 @HiltViewModel
 class PartTimeMainViewModel @Inject constructor(
     private val savedStateHandle: SavedStateHandle
 ) : BaseViewModel() {
 
     val mKeywordLiveData = MutableLiveData<String>()  //搜索Key值
-    val mSortTypeLD = MutableLiveData(1)  //排序类型值 1.推荐 2.最新 3.附近
-    val mPopupPositionTypeLD = MutableLiveData(0)  //下拉选变色记录索引
-
     var mCurPage = 1
     private var isNeedPlaceHolder = true
     var isNeedCleanAllData = true
-    var mDatas = mutableListOf<PartJobResult>()
-    val mAdapter by lazy { PartTimeJobAdapter(BR.item, mDatas) }
+
+    var mNewsJobDataes = mutableListOf<String>()
+    val mNewJobAdapter by lazy { BaseDataBindingAdapter(R.layout.item_part_time_new_job, BR.item, mNewsJobDataes) }
+
+    var mAllJobDataes = mutableListOf<PartJobResult>()
+    val mAllJobAdapter by lazy { PartTimeJobAdapter(BR.item, mAllJobDataes) }
 
     /**
      * 获取兼职工作列表
      */
+
     fun requestJobList(): LiveData<Boolean> {
         val liveData = MutableLiveData<Boolean>()
 
         launchOnUI {
             //开始Loading
             if (isNeedPlaceHolder) loadStartLoading()
+
+
+            async {
+                if (mCurPage == 1) {
+                    mNewsJobDataes.clear()
+                    for (i in 1..5) {
+                        mNewsJobDataes.add(i.toString())
+                    }
+                }
+            }
+            mNewJobAdapter.notifyDataSetChanged()
+
             val result = withContext(Dispatchers.IO) {
                 delay(1000)
 
@@ -83,31 +101,30 @@ class PartTimeMainViewModel @Inject constructor(
     }
 
     //处理数据-添加或刷新
-    @SuppressLint("NotifyDataSetChanged")
     private fun handleData(list: List<PartJobResult>?) {
         if (!list.checkEmpty()) {
             //有数据,判断是刷新还是加载更多的数据
             if (isNeedCleanAllData) {
                 //刷新的方式
-                mDatas.clear()
-                mDatas.addAll(list!!)
-                mAdapter.notifyDataSetChanged()
+                mAllJobDataes.clear()
+                mAllJobDataes.addAll(list!!)
+                mAllJobAdapter.notifyDataSetChanged()
             } else {
                 //加载更多
-                mDatas.addAll(list!!)
-                mAdapter.notifyItemRangeInserted(mDatas.size - list.size, list.size)
-                mAdapter.loadMoreModule.loadMoreComplete()
+                mAllJobDataes.addAll(list!!)
+                mAllJobAdapter.notifyItemRangeInserted(mAllJobDataes.size - list.size, list.size)
+                mAllJobAdapter.loadMoreModule.loadMoreComplete()
             }
         } else {
             //展示无数据
             if (isNeedCleanAllData && mCurPage == 1) {
-                mDatas.clear()
-                mDatas.add(PartJobResult())  //空视图
-                mAdapter.notifyDataSetChanged()
-                mAdapter.loadMoreModule.loadMoreEnd()
+                mAllJobDataes.clear()
+                mAllJobDataes.add(PartJobResult())  //空视图
+                mAllJobAdapter.notifyDataSetChanged()
+                mAllJobAdapter.loadMoreModule.loadMoreEnd()
             } else {
                 //如果是加载更多,展示加载完成,没有更多数据了
-                mAdapter.loadMoreModule.loadMoreEnd()
+                mAllJobAdapter.loadMoreModule.loadMoreEnd()
             }
         }
         isNeedPlaceHolder = false

+ 34 - 32
cpt_parttime/src/main/java/com/hongyegroup/cpt_parttime/ui/PartTimeMainFragment.kt

@@ -12,6 +12,7 @@ import com.guadou.cs_cptservices.interfaces.IFragmentRefresh
 import com.guadou.lib_baselib.bean.DataBindingConfig
 import com.guadou.lib_baselib.engine.toast
 import com.guadou.lib_baselib.ext.dp2px
+import com.guadou.lib_baselib.ext.horizontal
 import com.guadou.lib_baselib.ext.vertical
 import com.guadou.lib_baselib.utils.KeyboardUtils
 import com.hongyegroup.cpt_parttime.BR
@@ -20,6 +21,7 @@ import com.hongyegroup.cpt_parttime.databinding.FragmentParttimeMainBinding
 import com.hongyegroup.cpt_parttime.mvvm.PartTimeMainViewModel
 import com.scwang.smart.refresh.layout.api.RefreshLayout
 import com.scwang.smart.refresh.layout.listener.OnRefreshListener
+import kotlinx.coroutines.flow.MutableStateFlow
 
 /**
  * 兼职模块的首页Frgment
@@ -48,7 +50,7 @@ class PartTimeMainFragment : YYBaseVDBFragment<PartTimeMainViewModel, FragmentPa
     private fun initData() {
         mViewModel.requestJobList().observe(this) {
             mBinding.refreshLayout.finishRefresh()
-            mViewModel.mAdapter.loadMoreModule.isEnableLoadMore = true
+            mViewModel.mAllJobAdapter.loadMoreModule.isEnableLoadMore = true
 
             //清楚悬停头缓存
             if (mViewModel.isNeedCleanAllData) {
@@ -58,21 +60,23 @@ class PartTimeMainFragment : YYBaseVDBFragment<PartTimeMainViewModel, FragmentPa
     }
 
     private fun initRV() {
+        //顶部的横向RV使用
+        mBinding.rvNewJob.horizontal().adapter = mViewModel.mNewJobAdapter
 
         //悬停头的定义
         val listener: PowerGroupListener = object : PowerGroupListener {
             override fun getGroupName(position: Int): String? {
                 //获取组名,用于判断是否是同一组
-                return if (mViewModel.mDatas.size > position) {
-                    mViewModel.mDatas[position].groupDate
+                return if (mViewModel.mAllJobDataes.size > position) {
+                    mViewModel.mAllJobDataes[position].groupDate
                 } else null
             }
 
             override fun getGroupView(position: Int): View {
                 //获取自定定义的组View
-                return if (mViewModel.mDatas.size > position) {
+                return if (mViewModel.mAllJobDataes.size > position) {
                     layoutInflater.inflate(R.layout.item_header_job_date, null, false).apply {
-                        findViewById<TextView>(R.id.tv_head_job_date).text = mViewModel.mDatas[position].groupDate
+                        findViewById<TextView>(R.id.tv_head_job_date).text = mViewModel.mAllJobDataes[position].groupDate
                     }
                 } else {
                     View(mActivity).apply { setBackgroundColor(Color.WHITE) }
@@ -89,18 +93,18 @@ class PartTimeMainFragment : YYBaseVDBFragment<PartTimeMainViewModel, FragmentPa
             .build()
 
         //设置悬停头和Adapter
-        mBinding.recyclerView.vertical()
+        mBinding.rvAllJob.vertical()
             .apply {
                 addItemDecoration(mTopDecoration!!)
-                adapter = mViewModel.mAdapter
+                adapter = mViewModel.mAllJobAdapter
             }
     }
 
     private fun initListener() {
         //Adapter的滑动监听,监听加载更多
-        mViewModel.mAdapter.loadMoreModule.isEnableLoadMore = false
-        mViewModel.mAdapter.loadMoreModule.preLoadNumber = 4
-        mViewModel.mAdapter.loadMoreModule.setOnLoadMoreListener(this)
+        mViewModel.mAllJobAdapter.loadMoreModule.isEnableLoadMore = false
+        mViewModel.mAllJobAdapter.loadMoreModule.preLoadNumber = 4
+        mViewModel.mAllJobAdapter.loadMoreModule.setOnLoadMoreListener(this)
 
         //刷新控件初始化
         mBinding.refreshLayout.setEnableNestedScroll(true)
@@ -109,9 +113,9 @@ class PartTimeMainFragment : YYBaseVDBFragment<PartTimeMainViewModel, FragmentPa
         mBinding.refreshLayout.setOnRefreshListener(this)
 
         //Item点击
-        mViewModel.mAdapter.addChildClickViewIds(R.id.ll_job_root, R.id.cl_banner_root)
-        mViewModel.mAdapter.setOnItemChildClickListener { _, view, position ->
-            val item = mViewModel.mDatas[position]
+        mViewModel.mAllJobAdapter.addChildClickViewIds(R.id.ll_job_root, R.id.cl_banner_root)
+        mViewModel.mAllJobAdapter.setOnItemChildClickListener { _, view, position ->
+            val item = mViewModel.mAllJobDataes[position]
             when (view.id) {
                 R.id.ll_job_root -> {
                     mClickProxy.gotoJobDetailPage()
@@ -120,14 +124,18 @@ class PartTimeMainFragment : YYBaseVDBFragment<PartTimeMainViewModel, FragmentPa
                     toast("点击banner")
                 }
             }
+        }
 
+        //新工作的点击-进入详情
+        mViewModel.mNewJobAdapter.setOnItemClickListener { _, view, position ->
+            mClickProxy.gotoJobDetailPage()
         }
     }
 
     override fun onRefresh(refreshLayout: RefreshLayout) {
         mViewModel.isNeedCleanAllData = true
-        mViewModel.mAdapter.loadMoreModule.loadMoreComplete()
-        mViewModel.mAdapter.loadMoreModule.isEnableLoadMore = false
+        mViewModel.mAllJobAdapter.loadMoreModule.loadMoreComplete()
+        mViewModel.mAllJobAdapter.loadMoreModule.isEnableLoadMore = false
         //直接调用,参数从成员变量中获取
         mViewModel.mCurPage = 1
         initData()
@@ -141,10 +149,11 @@ class PartTimeMainFragment : YYBaseVDBFragment<PartTimeMainViewModel, FragmentPa
 
     //自动刷新
     override fun scrollTopRefresh() {
-        if (mViewModel.mDatas.size > 1) {
-            mBinding.recyclerView.scrollToPosition(0)
+        if (mViewModel.mAllJobDataes.size > 1) {
+            mBinding.rvAllJob.scrollToPosition(0)
         }
         mBinding.refreshLayout.autoRefresh()
+
     }
 
     /**
@@ -152,6 +161,8 @@ class PartTimeMainFragment : YYBaseVDBFragment<PartTimeMainViewModel, FragmentPa
      */
     inner class ClickProxy {
 
+        var filterIndex = MutableStateFlow(-1)
+
         //执行搜索
         fun doSearch() {
             KeyboardUtils.hideSoftInput(mActivity)
@@ -164,31 +175,22 @@ class PartTimeMainFragment : YYBaseVDBFragment<PartTimeMainViewModel, FragmentPa
             doSearch()
         }
 
-        //跳转页面-选择城市
-        fun gotoChooseCityPage() {
-
-        }
-
         //跳转页面-兼职工作详情
         fun gotoJobDetailPage() {
             PartTimeJobDetailActivity.startInstance()
         }
 
-        //推荐的排序
-        fun switchReCommend() {
-            mViewModel.mSortTypeLD.value = 1
+        fun filterIndustry() {
+            filterIndex.value = 0
         }
 
-        //最新的排序
-        fun switchlatested() {
-            mViewModel.mSortTypeLD.value = 2
+        fun filterDate() {
+            filterIndex.value = 1
         }
 
-        //附近的排序
-        fun switchNearby() {
-            mViewModel.mSortTypeLD.value = 3
+        fun filterOption() {
+            filterIndex.value = 2
         }
-
     }
 
 }

+ 11 - 0
cpt_parttime/src/main/res/color/selector_filter_date.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:color="@color/white" android:state_selected="true" />
+    <item android:color="@color/white" android:state_active="true" />
+    <item android:color="@color/white" android:state_pressed="true" />
+    <item android:color="@color/white" android:state_checked="true" />
+    <item android:color="@color/app_blue" android:state_selected="false" />
+    <item android:color="@color/app_blue" android:state_active="false" />
+    <item android:color="@color/app_blue" android:state_pressed="false" />
+    <item android:color="@color/app_blue" android:state_checked="false" />
+</selector>

+ 11 - 0
cpt_parttime/src/main/res/color/selector_filter_industry.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:color="@color/white" android:state_selected="true" />
+    <item android:color="@color/white" android:state_active="true" />
+    <item android:color="@color/white" android:state_pressed="true" />
+    <item android:color="@color/white" android:state_checked="true" />
+    <item android:color="@color/text_yellow_ff9300" android:state_selected="false" />
+    <item android:color="@color/text_yellow_ff9300" android:state_active="false" />
+    <item android:color="@color/text_yellow_ff9300" android:state_pressed="false" />
+    <item android:color="@color/text_yellow_ff9300" android:state_checked="false" />
+</selector>

+ 11 - 0
cpt_parttime/src/main/res/color/selector_filter_option.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:color="@color/white" android:state_selected="true" />
+    <item android:color="@color/white" android:state_active="true" />
+    <item android:color="@color/white" android:state_pressed="true" />
+    <item android:color="@color/white" android:state_checked="true" />
+    <item android:color="@color/profile_red" android:state_selected="false" />
+    <item android:color="@color/profile_red" android:state_active="false" />
+    <item android:color="@color/profile_red" android:state_pressed="false" />
+    <item android:color="@color/profile_red" android:state_checked="false" />
+</selector>

BIN
cpt_parttime/src/main/res/drawable-xhdpi/part_new_job_item_bg.webp


BIN
cpt_parttime/src/main/res/drawable-xxhdpi/date_black.webp


BIN
cpt_parttime/src/main/res/drawable-xxhdpi/industry_black.webp


BIN
cpt_parttime/src/main/res/drawable-xxhdpi/location_address_icon.webp


BIN
cpt_parttime/src/main/res/drawable-xxhdpi/part_filterby_white.png


+ 112 - 171
cpt_parttime/src/main/res/layout/fragment_parttime_main.xml

@@ -40,31 +40,6 @@
             android:paddingRight="@dimen/d_15dp">
 
             <LinearLayout
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:gravity="center_vertical"
-                android:orientation="horizontal"
-                binding:clicks="@{click.gotoChooseCityPage}">
-
-                <ImageView
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginTop="@dimen/d_2dp"
-                    android:src="@drawable/location_address_icon" />
-
-                <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginLeft="@dimen/d_5dp"
-                    android:gravity="center"
-                    android:text="武汉"
-                    android:textColor="@color/black"
-                    android:textSize="@dimen/d_15sp" />
-
-            </LinearLayout>
-
-
-            <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="32dp"
                 android:layout_marginLeft="@dimen/d_15dp"
@@ -106,180 +81,146 @@
 
             </LinearLayout>
 
+
         </LinearLayout>
 
         <View
             android:layout_width="match_parent"
-            android:layout_height="@dimen/d_1dp"
+            android:layout_height="@dimen/d_0.7dp"
             android:background="@color/main_divider" />
 
-        <androidx.coordinatorlayout.widget.CoordinatorLayout
+        <androidx.constraintlayout.widget.ConstraintLayout
             android:layout_width="match_parent"
-            android:layout_height="match_parent">
+            android:layout_height="wrap_content"
+            android:orientation="horizontal"
+            android:paddingTop="@dimen/d_8dp"
+            android:paddingBottom="@dimen/d_10dp">
 
-            <!--    顶部的筛选     -->
-            <com.google.android.material.appbar.AppBarLayout
-                android:id="@+id/app_bar_layout"
-                android:layout_width="match_parent"
+            <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.filterIndex == 0? @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.filterIndex == 0? @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.filterIndex == 0}" />
+
+            <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.filterIndex == 1? @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.filterIndex == 1? @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.filterIndex == 1}" />
+
+            <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="@color/white">
+                android:background="@{click.filterIndex == 2? @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.filterIndex == 2? @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.filterIndex == 2}" />
+
+        </androidx.constraintlayout.widget.ConstraintLayout>
+
+        <!--   刷新+列表   -->
+        <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" />
 
-                <LinearLayout
+            <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:layout_scrollFlags="scroll|snap|enterAlways">
+                    android:background="@color/page_bg_f4"
+                    app:elevation="0dp">
 
                     <LinearLayout
                         android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:layout_marginLeft="@dimen/d_12dp"
-                        android:layout_marginTop="@dimen/d_12dp"
-                        android:layout_marginRight="@dimen/d_12dp"
-                        android:gravity="center_vertical"
-                        android:orientation="horizontal">
-
-                        <TextView
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:text="兼职推荐"
-                            android:textColor="@color/black_33"
-                            android:textSize="@{viewModel.mSortTypeLD == 1?@dimen/d_17sp:@dimen/d_15sp}"
-                            binding:clicks="@{click.switchReCommend}"
-                            binding:typefaceMediumOrBold="@{viewModel.mSortTypeLD == 1}"
-                            tools:textSize="@dimen/d_17sp" />
-
-                        <TextView
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:layout_marginLeft="@dimen/d_15dp"
-                            android:text="最新"
-                            android:textColor="@color/black_33"
-                            android:textSize="@{viewModel.mSortTypeLD == 2?@dimen/d_17sp:@dimen/d_15sp}"
-                            binding:clicks="@{click.switchlatested}"
-                            binding:typefaceMediumOrBold="@{viewModel.mSortTypeLD == 2}" />
-
-                        <TextView
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:layout_marginLeft="@dimen/d_15dp"
-                            android:text="附近"
-                            android:textColor="@color/black_33"
-                            android:textSize="@{viewModel.mSortTypeLD == 3?@dimen/d_17sp:@dimen/d_15sp}"
-                            binding:clicks="@{click.switchNearby}"
-                            binding:typefaceMediumOrBold="@{viewModel.mSortTypeLD == 3}" />
-
-                    </LinearLayout>
-
-                    <LinearLayout
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:layout_marginTop="@dimen/d_8dp"
+                        android:layout_height="166dp"
                         android:orientation="horizontal"
-                        android:paddingLeft="@dimen/d_15dp"
-                        android:paddingRight="@dimen/d_15dp">
-
-                        <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                            android:layout_width="0dp"
-                            android:layout_height="@dimen/d_27dp"
-                            android:layout_weight="1"
-                            android:background="@{viewModel.MPopupPositionTypeLD==1?@drawable/shape_blue_round2_border:@drawable/shape_white_gray_round2}"
-                            android:drawableRight="@{viewModel.MPopupPositionTypeLD==1?@drawable/ic_drop_up_blue:@drawable/ic_drop_down_gray}"
-                            android:gravity="center"
-                            android:paddingLeft="@dimen/d_8dp"
-                            android:paddingRight="@dimen/d_8dp"
-                            android:text="全武汉"
-                            android:textColor="@{viewModel.MPopupPositionTypeLD==1?@color/app_blue:@color/gray_66}"
-                            android:textSize="@dimen/d_12sp"
-                            tools:drawableRight="@drawable/ic_drop_down_gray" />
-
-                        <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                            android:layout_width="0dp"
-                            android:layout_height="@dimen/d_27dp"
-                            android:layout_marginLeft="@dimen/d_5dp"
-                            android:layout_weight="1"
-                            android:background="@{viewModel.MPopupPositionTypeLD==2?@drawable/shape_blue_round2_border:@drawable/shape_white_gray_round2}"
-                            android:drawableRight="@{viewModel.MPopupPositionTypeLD==2?@drawable/ic_drop_up_blue:@drawable/ic_drop_down_gray}"
-                            android:gravity="center"
-                            android:paddingLeft="@dimen/d_8dp"
-                            android:paddingRight="@dimen/d_8dp"
-                            android:text="职位类型"
-                            android:textColor="@{viewModel.MPopupPositionTypeLD==2?@color/app_blue:@color/gray_66}"
-                            android:textSize="@dimen/d_12sp"
-                            tools:drawableRight="@drawable/ic_drop_down_gray" />
-
-                        <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                            android:layout_width="0dp"
-                            android:layout_height="@dimen/d_27dp"
-                            android:layout_marginLeft="@dimen/d_5dp"
-                            android:layout_weight="1"
-                            android:background="@{viewModel.MPopupPositionTypeLD==3?@drawable/shape_blue_round2_border:@drawable/shape_white_gray_round2}"
-                            android:drawableRight="@{viewModel.MPopupPositionTypeLD==3?@drawable/ic_drop_up_blue:@drawable/ic_drop_down_gray}"
-                            android:gravity="center"
-                            android:paddingLeft="@dimen/d_8dp"
-                            android:paddingRight="@dimen/d_8dp"
-                            android:text="日期"
-                            android:textColor="@{viewModel.MPopupPositionTypeLD==3?@color/app_blue:@color/gray_66}"
-                            android:textSize="@dimen/d_12sp"
-                            tools:drawableRight="@drawable/ic_drop_down_gray" />
-
-                        <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                            android:layout_width="0dp"
-                            android:layout_height="@dimen/d_27dp"
-                            android:layout_marginLeft="@dimen/d_5dp"
-                            android:layout_weight="1"
-                            android:background="@{viewModel.MPopupPositionTypeLD==4?@drawable/shape_blue_round2_border:@drawable/shape_white_gray_round2}"
-                            android:drawableRight="@{viewModel.MPopupPositionTypeLD==4?@drawable/ic_drop_up_blue:@drawable/ic_drop_down_gray}"
-                            android:gravity="center"
-                            android:paddingLeft="@dimen/d_8dp"
-                            android:paddingRight="@dimen/d_8dp"
-                            android:text="筛选"
-                            android:textColor="@{viewModel.MPopupPositionTypeLD==4?@color/app_blue:@color/gray_66}"
-                            android:textSize="@dimen/d_12sp"
-                            tools:drawableRight="@drawable/ic_drop_down_gray" />
+                        app:layout_scrollFlags="scroll">
 
-                    </LinearLayout>
-
-                    <View
-                        android:id="@+id/view_popup_divider"
-                        android:layout_width="match_parent"
-                        android:layout_height="@dimen/d_1dp"
-                        android:layout_marginTop="@dimen/d_10dp"
-                        android:background="@color/main_divider" />
+                        <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>
+                    </LinearLayout>
 
-            <!--   刷新+列表   -->
-            <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:layout_behavior="@string/appbar_scrolling_view_behavior"
-                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" />
+                </com.google.android.material.appbar.AppBarLayout>
 
                 <androidx.recyclerview.widget.RecyclerView
-                    android:id="@+id/recycler_view"
+                    android:id="@+id/rv_all_job"
                     android:layout_width="match_parent"
                     android:layout_height="match_parent"
                     android:overScrollMode="never"
-                    android:scrollbars="vertical">
+                    android:scrollbars="vertical"
+                    app:layout_behavior="@string/appbar_scrolling_view_behavior">
 
                 </androidx.recyclerview.widget.RecyclerView>
 
-            </com.scwang.smart.refresh.layout.SmartRefreshLayout>
+            </androidx.coordinatorlayout.widget.CoordinatorLayout>
 
-        </androidx.coordinatorlayout.widget.CoordinatorLayout>
+        </com.scwang.smart.refresh.layout.SmartRefreshLayout>
 
     </LinearLayout>
 

+ 190 - 0
cpt_parttime/src/main/res/layout/item_part_time_new_job.xml

@@ -0,0 +1,190 @@
+<?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">
+
+    <data>
+
+        <variable
+            name="item"
+            type="String" />
+
+        <import type="android.text.TextUtils" />
+
+    </data>
+
+    <LinearLayout
+        android:layout_width="316dp"
+        android:layout_height="wrap_content"
+        android:layout_marginRight="-5dp"
+        android:background="@drawable/part_new_job_item_bg"
+        android:orientation="vertical">
+
+        <com.guadou.lib_baselib.font_text_view.TextViewBold
+            android:id="@+id/tv_job_title"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="@dimen/d_23dp"
+            android:layout_marginTop="@dimen/d_15dp"
+            android:layout_marginRight="@dimen/d_23dp"
+            android:gravity="center_vertical"
+            android:ellipsize="end"
+            android:lines="2"
+            android:lineHeight="@dimen/d_17dp"
+            android:text="香格里拉大酒店需要大量经验丰富的员工,至少10人"
+            android:textAllCaps="true"
+            android:textColor="@color/notify_dark_blue"
+            android:textSize="@dimen/d_16sp" />
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="@dimen/d_23dp"
+            android:layout_marginTop="@dimen/d_5dp"
+            android:layout_marginRight="@dimen/d_23dp"
+            android:orientation="horizontal">
+
+            <ImageView
+                android:id="@+id/iv_job_img"
+                android:layout_width="60dp"
+                android:layout_height="43dp"
+                android:background="@drawable/placeholder_img_job_img"
+                android:scaleType="centerCrop" />
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:gravity="center_vertical"
+                android:orientation="vertical">
+
+                <!--   date   -->
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="0dp"
+                    android:layout_weight="1"
+                    android:gravity="center_vertical"
+                    android:orientation="horizontal">
+
+                    <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:text="日期:"
+                        android:textColor="@color/gray_76"
+                        android:textSize="@dimen/d_14sp" />
+
+                    <com.guadou.lib_baselib.font_text_view.TextViewMedium
+                        android:id="@+id/tv_date"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="@dimen/d_5dp"
+                        android:text="2022/06/29 周三"
+                        android:textColor="@color/text_orange_ff9300"
+                        android:textSize="@dimen/d_14sp" />
+
+                </LinearLayout>
+
+
+                <!--   time   -->
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="0dp"
+                    android:layout_weight="1"
+                    android:gravity="center_vertical"
+                    android:orientation="horizontal">
+
+                    <com.guadou.lib_baselib.font_text_view.TextViewRegular
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginStart="@dimen/d_10dp"
+                        android:layout_marginLeft="@dimen/d_10dp"
+                        android:text="时间:"
+                        android:textColor="@color/gray_76"
+                        android:textSize="@dimen/d_14sp" />
+
+                    <com.guadou.lib_baselib.font_text_view.TextViewMedium
+                        android:id="@+id/tv_time"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:fontFamily="sans-serif-light"
+                        android:text="06:00-23:30"
+                        android:textColor="@color/text_orange_ff9300"
+                        android:textSize="@dimen/d_14sp" />
+
+                </LinearLayout>
+
+            </LinearLayout>
+
+        </LinearLayout>
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/d_0.7dp"
+            android:layout_marginLeft="@dimen/d_9dp"
+            android:layout_marginTop="@dimen/d_12dp"
+            android:layout_marginRight="@dimen/d_9dp"
+            android:background="@color/divider_color_de" />
+
+        <LinearLayout
+            android:layout_width="wrap_content"
+            android:layout_height="0dp"
+            android:layout_weight="1"
+            android:gravity="center_vertical"
+            android:orientation="horizontal"
+            android:paddingBottom="8dp">
+
+            <LinearLayout
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/d_23dp"
+                android:gravity="center_vertical"
+                android:orientation="horizontal">
+
+                <com.guadou.lib_baselib.font_text_view.TextViewRegular
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginRight="5dp"
+                    android:text="总计"
+                    android:textColor="@color/gray_76"
+                    android:textSize="@dimen/d_15sp" />
+
+                <com.guadou.lib_baselib.font_text_view.TextViewMedium
+                    android:id="@+id/tv_total_money"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="¥80"
+                    android:textColor="@color/profile_red"
+                    android:textSize="@dimen/d_20sp" />
+
+            </LinearLayout>
+
+
+            <View
+                android:layout_width="0dp"
+                android:layout_height="1dp"
+                android:layout_weight="1" />
+
+            <com.guadou.lib_baselib.font_text_view.TextViewMedium
+                android:id="@+id/tv_job_rate"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="¥10"
+                android:textColor="@color/app_blue"
+                android:textSize="@dimen/d_15sp" />
+
+            <com.guadou.lib_baselib.font_text_view.TextViewRegular
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginRight="@dimen/d_23dp"
+                android:text="/时"
+                android:textColor="@color/gray_76"
+                android:textSize="@dimen/d_15sp"
+                android:textStyle="bold" />
+
+        </LinearLayout>
+
+
+    </LinearLayout>
+
+</layout>

+ 1 - 0
cs_baselib/src/main/res/values/colors.xml

@@ -9,6 +9,7 @@
     <color name="white">#ffffff</color>
     <color name="black">#000000</color>
     <color name="divider_color">#D2D2D2</color>
+    <color name="divider_color_de">#dedede</color>
     <color name="divider_color_f0">#f0f0f0</color>
     <color name="divider_color_f689">#f6f8f9</color>
     <color name="gray">#cccccc</color>

+ 1 - 1
cs_baselib/src/main/res/values/styles.xml

@@ -7,7 +7,7 @@
         <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
         <item name="colorAccent">@color/colorAccent</item>
         <item name="android:windowAnimationStyle">@style/my_animation_activity</item>
-        <item name="android:windowBackground">@null</item>
+<!--        <item name="android:windowBackground">@null</item>-->
     </style>
 
     <style name="AppThemeLight" parent="Theme.AppCompat.DayNight.NoActionBar">

+ 5 - 0
cs_cptServices/src/main/java/com/guadou/cs_cptservices/binding/BindingView.kt

@@ -17,6 +17,11 @@ fun isInVisible(view: View, isVisible: Boolean) {
     view.visibility = if (isVisible) View.VISIBLE else View.INVISIBLE
 }
 
+@BindingAdapter("setSelected")
+fun setSelected(view: View, isSelected: Boolean) {
+    view.isSelected = isSelected
+}
+
 /**
  * 点击事件防抖动的点击
  */

cs_cptServices/src/main/res/drawable-xhdpi/plachholder_img_job_img.webp → cs_cptServices/src/main/res/drawable-xhdpi/placeholder_img_job_img.webp


+ 0 - 16
cs_cptServices/src/main/res/drawable/selector_btn_white_gray_bg.xml

@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-
-    <item android:state_pressed="true">
-        <shape android:shape="rectangle">
-            <solid android:color="@color/white_pressed" />
-        </shape>
-    </item>
-
-    <item android:state_pressed="false">
-        <shape android:shape="rectangle">
-            <solid android:color="@color/white" />
-        </shape>
-    </item>
-
-</selector>

+ 7 - 0
cs_cptServices/src/main/res/drawable/selector_white_item_click_bg.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item android:drawable="@color/white_pressed" android:state_pressed="true" />
+    <item android:drawable="@color/white" />
+
+</selector>

cs_cptServices/src/main/res/drawable/selector_profile_me_bg.xml → cs_cptServices/src/main/res/drawable/selector_white_round10_item_click_bg.xml


+ 2 - 0
cs_cptServices/src/main/res/values/colors.xml

@@ -2,6 +2,7 @@
 <resources >
 
     <color name="page_bg">#f1f1f1</color>
+    <color name="page_bg_f4">#f4f4f4</color>
     <color name="app_blue">#0689fb</color>
     <color name="app_blue_selected_pre">#990689FB</color>
     <color name="gray_99">#999999</color>
@@ -12,6 +13,7 @@
     <color name="black_33">#333333</color>
     <color name="main_divider">#ECECEC</color>
     <color name="text_orange">#FD4C00</color>
+    <color name="text_orange_ff9300">#FF9300</color>
     <color name="text_blue">#008CFF</color>
     <color name="text_blue_3779ff">#3779FF</color>
     <color name="profile_red">#FF5E75</color>