Browse Source

电子钱包的历史列表页面

liukai 2 years ago
parent
commit
9055be37e3

+ 1 - 0
cpt_ewallet/src/main/AndroidManifest.xml

@@ -4,6 +4,7 @@
 
     <application android:allowBackup="true">
 
+        <activity android:name=".ui.EWalletHistoryActivity"/>
 
     </application>
 

+ 13 - 0
cpt_ewallet/src/main/java/com/hongyegroup/cpt_ewallet/bean/EWalletHistoryBean.java

@@ -0,0 +1,13 @@
+package com.hongyegroup.cpt_ewallet.bean;
+
+
+public class EWalletHistoryBean {
+
+    public String id;
+    public String title;
+    public String content;
+    public String date;
+
+    public String groupDate;
+    public boolean isShowDivider;
+}

+ 128 - 0
cpt_ewallet/src/main/java/com/hongyegroup/cpt_ewallet/mvvm/EWalletHistoryViewModel.kt

@@ -0,0 +1,128 @@
+package com.hongyegroup.cpt_ewallet.mvvm
+
+import android.annotation.SuppressLint
+import android.view.View
+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.guadou.lib_baselib.utils.CommUtils
+import com.hongyegroup.cpt_ewallet.BR
+import com.hongyegroup.cpt_ewallet.R
+import com.hongyegroup.cpt_ewallet.bean.EWalletHistoryBean
+import dagger.hilt.android.lifecycle.HiltViewModel
+import kotlinx.coroutines.delay
+import javax.inject.Inject
+
+@HiltViewModel
+class EWalletHistoryViewModel @Inject constructor(
+    private val savedStateHandle: SavedStateHandle
+) : BaseViewModel() {
+
+    var mKeywordLiveData = MutableLiveData<String>()
+
+    var mCurPage = 1
+    private var isNeedPlaceHolder = true
+    var isNeedCleanAllData = true
+    var mHistoryDatas = mutableListOf<EWalletHistoryBean>()
+    val mAdapter by lazy { BaseDataBindingAdapter(R.layout.item_ewallet_history, BR.item, mHistoryDatas) }
+
+
+    fun getHistoryList(): LiveData<Boolean> {
+        val liveData = MutableLiveData<Boolean>()
+
+        launchOnUI {
+            //开始Loading
+            if (isNeedPlaceHolder) loadStartLoading()
+
+            delay(1500)
+            val list = mutableListOf<EWalletHistoryBean>()
+            for (i in 1..10) {
+                list.add(EWalletHistoryBean().apply {
+                    groupDate = "2022-07-0$mCurPage"
+                })
+            }
+
+            handleData(list)
+            loadSuccess()
+            liveData.postValue(true)
+
+            //返回的数据是封装过的,检查是否成功
+//            result.checkResult({
+//                loadSuccess()
+//                //成功
+//                handleData(it?.list)
+//                liveData.postValue(true)
+//            }, {
+//                //失败
+//                if (isNeedPlaceHolder) {
+//                    loadError(it)
+//                } else {
+//                    toast(it)
+//                }
+//                liveData.postValue(false)
+//            })
+        }
+
+        return liveData
+    }
+
+    //处理数据-添加或刷新
+    @SuppressLint("SetTextI18n", "NotifyDataSetChanged")
+    private fun handleData(list: List<EWalletHistoryBean>?) {
+        if (!list.checkEmpty()) {
+            //有数据,判断是刷新还是加载更多的数据
+            if (isNeedCleanAllData) {
+                //刷新的方式
+                mHistoryDatas.clear()
+                addAllHistoryBean(list!!)
+                mAdapter.notifyDataSetChanged()
+            } else {
+                //加载更多
+                addAllHistoryBean(list!!)
+//                mAdapter.notifyItemRangeInserted((mHistoryDatas.size - list.size , list.size )
+//                mAdapter.notifyItemRangeChanged(mHistoryDatas.size - list.size - 1, list.size + 1)
+                mAdapter.notifyDataSetChanged()
+                mAdapter.loadMoreModule.loadMoreComplete()
+            }
+        } else {
+            //展示无数据
+            if (isNeedCleanAllData && mCurPage == 1) {
+                mHistoryDatas.clear()
+                mAdapter.notifyDataSetChanged()
+                //展示无数据的布局
+                val emptyView: View = CommUtils.inflate(R.layout.item_empty_layout)
+                mAdapter.setEmptyView(emptyView)
+            } else {
+                //如果是加载更多,展示加载完成,没有更多数据了
+                mAdapter.loadMoreModule.loadMoreEnd()
+            }
+        }
+        isNeedPlaceHolder = false
+        isNeedCleanAllData = false
+    }
+
+    //赋值并判断月份的分割线字段
+    private fun addAllHistoryBean(list: List<EWalletHistoryBean>) {
+        mHistoryDatas.addAll(list)
+
+        if (mHistoryDatas.size == 1) {
+            mHistoryDatas[0].isShowDivider = false
+        } else {
+            mHistoryDatas.last().isShowDivider = false
+
+            mHistoryDatas.forEachIndexed { index, bean ->
+                if (index > 0) {
+                    val preBean = mHistoryDatas[index - 1]
+                    preBean.isShowDivider = bean.groupDate != preBean.groupDate
+                }
+            }
+
+        }
+
+
+    }
+
+}

+ 6 - 5
cpt_ewallet/src/main/java/com/hongyegroup/cpt_ewallet/mvvm/EWalletMainViewModel.kt

@@ -4,8 +4,9 @@ import android.annotation.SuppressLint
 import androidx.lifecycle.SavedStateHandle
 import com.guadou.cs_cptservices.binding.BaseDataBindingAdapter
 import com.guadou.lib_baselib.base.vm.BaseViewModel
-import com.hongyegroup.cpt_ewallet.R
 import com.hongyegroup.cpt_ewallet.BR
+import com.hongyegroup.cpt_ewallet.R
+import com.hongyegroup.cpt_ewallet.bean.EWalletHistoryBean
 import dagger.hilt.android.lifecycle.HiltViewModel
 import javax.inject.Inject
 
@@ -14,16 +15,16 @@ class EWalletMainViewModel @Inject constructor(
     private val savedStateHandle: SavedStateHandle
 ) : BaseViewModel() {
 
-    var mHistoryDatas = mutableListOf<String>()
+    var mHistoryDatas = mutableListOf<EWalletHistoryBean>()
     val mAdapter by lazy { BaseDataBindingAdapter(R.layout.item_ewallet_history, BR.item, mHistoryDatas) }
 
 
     @SuppressLint("NotifyDataSetChanged")
     fun setupDataes() {
         mHistoryDatas.clear()
-        mHistoryDatas.add("1")
-        mHistoryDatas.add("1")
-        mHistoryDatas.add("1")
+        mHistoryDatas.add(EWalletHistoryBean())
+        mHistoryDatas.add(EWalletHistoryBean())
+        mHistoryDatas.add(EWalletHistoryBean())
 
         mAdapter.notifyDataSetChanged()
     }

+ 180 - 0
cpt_ewallet/src/main/java/com/hongyegroup/cpt_ewallet/ui/EWalletHistoryActivity.kt

@@ -0,0 +1,180 @@
+package com.hongyegroup.cpt_ewallet.ui
+
+import android.graphics.Color
+import android.os.Bundle
+import android.view.View
+import android.widget.TextView
+import com.chad.library.adapter.base.listener.OnLoadMoreListener
+import com.gavin.com.library.PowerfulStickyDecoration
+import com.gavin.com.library.listener.PowerGroupListener
+import com.guadou.cs_cptservices.base.activity.YYBaseVDBLoadingActivity
+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.dp2px
+import com.guadou.lib_baselib.ext.gotoActivity
+import com.guadou.lib_baselib.ext.vertical
+import com.guadou.lib_baselib.utils.KeyboardUtils
+import com.guadou.lib_baselib.view.gloading.GLoadingTitleStatus
+import com.guadou.lib_baselib.view.gloading.Gloading
+import com.guadou.lib_baselib.view.gloading.GloadingPlaceHolderlAdapter
+import com.hongyegroup.cpt_ewallet.BR
+import com.hongyegroup.cpt_ewallet.R
+import com.hongyegroup.cpt_ewallet.databinding.ActivityEwalletHistoryBinding
+import com.hongyegroup.cpt_ewallet.mvvm.EWalletHistoryViewModel
+import com.scwang.smart.refresh.layout.api.RefreshLayout
+import com.scwang.smart.refresh.layout.listener.OnRefreshListener
+
+/**
+ * 电子钱包的历史记录列表
+ */
+class EWalletHistoryActivity : YYBaseVDBLoadingActivity<EWalletHistoryViewModel, ActivityEwalletHistoryBinding>(), OnLoadMoreListener,
+    OnRefreshListener {
+
+    private var mTopDecoration: PowerfulStickyDecoration? = null
+    private val clickProxy by lazy { ClickProxy() }
+
+    companion object {
+        fun startInstance() {
+            commContext().gotoActivity<EWalletHistoryActivity>()
+        }
+    }
+
+    override fun getDataBindingConfig(): DataBindingConfig {
+        return DataBindingConfig(R.layout.activity_ewallet_history, BR.viewModel, mViewModel)
+            .addBindingParams(BR.click, clickProxy)
+    }
+
+    //重新生成GLoading对象
+    override fun generateGLoading(): Gloading.Holder {
+        return Gloading.from(GloadingPlaceHolderlAdapter(R.layout.layout_placeholder_normal))
+            .wrap(this, GLoadingTitleStatus(true, true, false))
+            .withRetry {
+                initData()
+            }
+    }
+
+    override fun startObserve() {
+
+    }
+
+    override fun init(savedInstanceState: Bundle?) {
+        initRV()
+        initData()
+        initListener()
+    }
+
+    private fun initData() {
+        mViewModel.getHistoryList().observe(this) {
+            mBinding.refreshLayout.finishRefresh()
+            mViewModel.mAdapter.loadMoreModule.isEnableLoadMore = true
+        }
+    }
+
+    private fun initRV() {
+        //悬停头的定义
+        val listener: PowerGroupListener = object : PowerGroupListener {
+            override fun getGroupName(position: Int): String? {
+                //获取组名,用于判断是否是同一组
+                return if (mViewModel.mHistoryDatas.size > position) {
+                    mViewModel.mHistoryDatas[position].groupDate
+                } else null
+            }
+
+            override fun getGroupView(position: Int): View {
+                //获取自定定义的组View
+                return if (mViewModel.mHistoryDatas.size > position) {
+                    layoutInflater.inflate(R.layout.item_header_history_income, null, false).apply {
+                        findViewById<TextView>(R.id.tv_head_job_date).text = mViewModel.mHistoryDatas[position].groupDate
+                    }
+                } else {
+                    View(mActivity).apply { setBackgroundColor(Color.WHITE) }
+                }
+            }
+        }
+        mTopDecoration = PowerfulStickyDecoration.Builder
+            .init(listener)
+            .setGroupHeight(dp2px(40f))
+            .setCacheEnable(true)
+            .setHeaderCount(0) //是否有头布局->头布局的数量
+            .setOnClickListener { _, _ -> //Head点击事件
+                toast("去查看当月收入支出账单")
+            }
+            .build()
+
+        mBinding.recyclerView.vertical().apply {
+            addItemDecoration(mTopDecoration!!)
+            adapter = mViewModel.mAdapter
+
+        }
+    }
+
+    private fun initListener() {
+        //Adapter的滑动监听,监听加载更多
+        mViewModel.mAdapter.loadMoreModule.isEnableLoadMore = false
+        mViewModel.mAdapter.loadMoreModule.preLoadNumber = 4
+        mViewModel.mAdapter.loadMoreModule.setOnLoadMoreListener(this)
+
+        //刷新控件初始化
+        mBinding.refreshLayout.setEnableNestedScroll(true)
+        mBinding.refreshLayout.setEnableLoadMore(false)
+        mBinding.refreshLayout.setEnableRefresh(true)
+        mBinding.refreshLayout.setOnRefreshListener(this)
+
+        //Item点击
+        mViewModel.mAdapter.setOnItemClickListener { _, _, position ->
+            val item = mViewModel.mHistoryDatas[position]
+            clickProxy.gotoHistoryDetailPage()
+        }
+    }
+
+    override fun onRefresh(refreshLayout: RefreshLayout) {
+        mTopDecoration?.clearCache()
+
+        mViewModel.isNeedCleanAllData = true
+        mViewModel.mAdapter.loadMoreModule.loadMoreComplete()
+        mViewModel.mAdapter.loadMoreModule.isEnableLoadMore = false
+        //直接调用,参数从成员变量中获取
+        mViewModel.mCurPage = 1
+        initData()
+    }
+
+    override fun onLoadMore() {
+        mViewModel.isNeedCleanAllData = false
+        mViewModel.mCurPage++
+        initData()
+    }
+
+    /**
+     * DataBinding事件处理
+     */
+    inner class ClickProxy {
+
+        fun backPage() {
+            finish()
+        }
+
+        //执行搜索
+        fun doSearch() {
+            KeyboardUtils.hideSoftInput(mActivity)
+            mBinding.refreshLayout.autoRefresh()
+        }
+
+        //搜索的删除
+        fun searchDel() {
+            mViewModel.mKeywordLiveData.value = ""
+            doSearch()
+        }
+
+        //根据时间搜索
+        fun searchByData() {
+            toast("去新页面筛选时间")
+        }
+
+        //去历史详情页面
+        fun gotoHistoryDetailPage() {
+            toast("去历史详情页面")
+        }
+
+    }
+}

+ 37 - 15
cpt_ewallet/src/main/java/com/hongyegroup/cpt_ewallet/ui/EWalletMainFragment.kt

@@ -1,16 +1,12 @@
 package com.hongyegroup.cpt_ewallet.ui
 
 import android.os.Bundle
-import android.view.View
-import com.guadou.cs_cptservices.base.fragment.YYBaseVDBLoadingFragment
+import com.guadou.cs_cptservices.base.fragment.YYBaseVDBFragment
 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.vertical
 import com.guadou.lib_baselib.utils.CommUtils
-import com.guadou.lib_baselib.view.gloading.GLoadingTitleStatus
-import com.guadou.lib_baselib.view.gloading.Gloading
-import com.guadou.lib_baselib.view.gloading.GloadingRoatingAdapter
 import com.hongyegroup.cpt_ewallet.BR
 import com.hongyegroup.cpt_ewallet.R
 import com.hongyegroup.cpt_ewallet.databinding.FragmentEwalletMainBinding
@@ -22,19 +18,14 @@ import com.scwang.smart.refresh.layout.listener.OnRefreshListener
  * 用于MainActivity的子Fragment
  * 钱包的主页
  */
-class EWalletMainFragment : YYBaseVDBLoadingFragment<EWalletMainViewModel, FragmentEwalletMainBinding>(), IFragmentRefresh,
+class EWalletMainFragment : YYBaseVDBFragment<EWalletMainViewModel, FragmentEwalletMainBinding>(), IFragmentRefresh,
     OnRefreshListener {
 
+    private val clickProxy by lazy { ClickProxy() }
+
     override fun getDataBindingConfig(): DataBindingConfig {
         return DataBindingConfig(R.layout.fragment_ewallet_main, BR.viewModel, mViewModel)
-            .addBindingParams(BR.click, ClickProxy())
-    }
-
-    //重新生成GLoading对象-跳动动画
-    override fun generateGLoading(view: View): Gloading.Holder {
-        return Gloading.from(GloadingRoatingAdapter())
-            .wrap(view, GLoadingTitleStatus(true, true, true))
-            .withRetry { onGoadingRetry() }
+            .addBindingParams(BR.click, clickProxy)
     }
 
     override fun startObserve() {
@@ -85,7 +76,7 @@ class EWalletMainFragment : YYBaseVDBLoadingFragment<EWalletMainViewModel, Fragm
         mBinding.refreshLayout.setOnRefreshListener(this)
 
         mViewModel.mAdapter.setOnItemClickListener { adapter, view, position ->
-            toast("点击进入发票详情")
+            clickProxy.gotoHistoryDetailPage()
         }
     }
 
@@ -99,6 +90,37 @@ class EWalletMainFragment : YYBaseVDBLoadingFragment<EWalletMainViewModel, Fragm
      */
     inner class ClickProxy {
 
+        //去历史页面
+        fun gotoEWalletHistoryPage() {
+            EWalletHistoryActivity.startInstance()
+        }
+
+        //去历史详情页面
+        fun gotoHistoryDetailPage() {
+            toast("去历史详情页面")
+        }
+
+        //去年度报表发票页面
+        fun gotoEWalletInviocePage() {
+            toast("去年度报表发票页面")
+        }
+
+        //去设置密码页面
+        fun gotoSetPsdPage() {
+            toast("去设置密码页面")
+        }
+
+        //去提现页面
+        fun gotoWithdrawalPage() {
+            toast("去提现页面")
+        }
+
+        //去提现预约页面
+        fun gotoAppointmentPage() {
+            toast("去提现预约页面")
+        }
+
+
     }
 
 }

+ 123 - 0
cpt_ewallet/src/main/res/layout/activity_ewallet_history.xml

@@ -0,0 +1,123 @@
+<?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="viewModel"
+            type="com.hongyegroup.cpt_ewallet.mvvm.EWalletHistoryViewModel" />
+
+        <variable
+            name="click"
+            type="com.hongyegroup.cpt_ewallet.ui.EWalletHistoryActivity.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">
+
+        <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">
+
+            <ImageView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="1.5dp"
+                android:src="@mipmap/iv_blue_back"
+                binding:clicks="@{click.backPage}" />
+
+            <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>
+
+            <ImageView
+                android:layout_width="21.5dp"
+                android:layout_height="20.5dp"
+                android:layout_marginLeft="@dimen/d_12dp"
+                android:src="@drawable/history_title_red_calendar_icon"
+                binding:clicks="@{click.searchByData}" />
+
+        </LinearLayout>
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/d_0.7dp"
+            android:background="@color/main_divider" />
+
+        <com.scwang.smart.refresh.layout.SmartRefreshLayout
+            android:id="@+id/refresh_layout"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            app:srlEnablePreviewInEditMode="false"
+            app:srlPrimaryColor="@color/white">
+
+            <com.scwang.smart.refresh.header.ClassicsHeader
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content" />
+
+            <com.guadou.cs_cptservices.widget.MyStickRecyclerView
+                android:id="@+id/recycler_view"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:overScrollMode="never"
+                android:scrollbars="none" />
+
+        </com.scwang.smart.refresh.layout.SmartRefreshLayout>
+
+
+    </LinearLayout>
+
+</layout>

+ 10 - 5
cpt_ewallet/src/main/res/layout/fragment_ewallet_main.xml

@@ -183,7 +183,8 @@
                             android:layout_height="wrap_content"
                             android:layout_weight="1"
                             android:gravity="center"
-                            android:orientation="vertical">
+                            android:orientation="vertical"
+                            binding:clicks="@{click.gotoWithdrawalPage}">
 
                             <ImageView
                                 android:layout_width="@dimen/d_35dp"
@@ -213,7 +214,8 @@
                             android:layout_height="wrap_content"
                             android:layout_weight="1"
                             android:gravity="center"
-                            android:orientation="vertical">
+                            android:orientation="vertical"
+                            binding:clicks="@{click.gotoAppointmentPage}">
 
                             <ImageView
                                 android:layout_width="@dimen/d_35dp"
@@ -246,7 +248,8 @@
                         android:gravity="center_vertical"
                         android:orientation="horizontal"
                         android:paddingLeft="@dimen/d_18dp"
-                        android:paddingRight="@dimen/d_18dp">
+                        android:paddingRight="@dimen/d_18dp"
+                        binding:clicks="@{click.gotoSetPsdPage}">
 
                         <ImageView
                             android:layout_width="@dimen/d_26dp"
@@ -288,7 +291,8 @@
                         android:gravity="center_vertical"
                         android:orientation="horizontal"
                         android:paddingLeft="@dimen/d_18dp"
-                        android:paddingRight="@dimen/d_18dp">
+                        android:paddingRight="@dimen/d_18dp"
+                        binding:clicks="@{click.gotoEWalletHistoryPage}">
 
                         <ImageView
                             android:layout_width="@dimen/d_25dp"
@@ -329,7 +333,8 @@
                         android:gravity="center_vertical"
                         android:orientation="horizontal"
                         android:paddingLeft="@dimen/d_18dp"
-                        android:paddingRight="@dimen/d_18dp">
+                        android:paddingRight="@dimen/d_18dp"
+                        binding:clicks="@{click.gotoEWalletInviocePage}">
 
                         <ImageView
                             android:layout_width="@dimen/d_25dp"

+ 10 - 2
cpt_ewallet/src/main/res/layout/item_ewallet_history.xml

@@ -8,7 +8,7 @@
 
         <variable
             name="item"
-            type="String" />
+            type="com.hongyegroup.cpt_ewallet.bean.EWalletHistoryBean" />
 
         <import type="android.text.TextUtils" />
 
@@ -74,12 +74,20 @@
 
         </RelativeLayout>
 
-
         <View
             android:layout_width="match_parent"
             android:layout_height="@dimen/d_0.7dp"
             android:background="@color/page_bg" />
 
+        <View
+            android:id="@+id/view_date_divider"
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/d_10dp"
+            android:background="@color/page_bg"
+            android:visibility="gone"
+            binding:isVisibleGone="@{item.isShowDivider}"
+            tools:visibility="visible" />
+
     </LinearLayout>
 
 </layout>

+ 36 - 0
cpt_ewallet/src/main/res/layout/item_header_history_income.xml

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="@dimen/d_40dp"
+    android:background="@color/white"
+    android:gravity="center_vertical"
+    android:orientation="horizontal"
+    android:paddingLeft="@dimen/d_15dp"
+    android:paddingRight="@dimen/d_15dp">
+
+    <com.guadou.lib_baselib.font_text_view.TextViewMedium
+        android:id="@+id/tv_head_job_date"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_weight="1"
+        android:text="2022年6月"
+        android:textColor="@color/notify_dark_blue"
+        android:textSize="@dimen/d_18sp" />
+
+    <com.guadou.lib_baselib.font_text_view.TextViewMedium
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="收入:"
+        android:textColor="@color/gray_76"
+        android:textSize="@dimen/d_15sp" />
+
+    <com.guadou.lib_baselib.font_text_view.TextViewMedium
+        android:id="@+id/tv_income"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="65.93"
+        android:textColor="@color/notify_dark_blue"
+        android:textSize="@dimen/d_15sp" />
+
+</LinearLayout>
+

+ 2 - 1
cpt_parttime/src/main/java/com/hongyegroup/cpt_parttime/ui/PartTimeMainFragment.kt

@@ -50,7 +50,6 @@ class PartTimeMainFragment : YYBaseVDBLoadingFragment<PartTimeMainViewModel, Fra
     }
 
     override fun init(savedInstanceState: Bundle?) {
-
         initRV()
         initData()
         initListener()
@@ -140,6 +139,8 @@ class PartTimeMainFragment : YYBaseVDBLoadingFragment<PartTimeMainViewModel, Fra
     }
 
     override fun onRefresh(refreshLayout: RefreshLayout) {
+        mTopDecoration?.clearCache()
+
         mViewModel.isNeedCleanAllData = true
         mViewModel.mAllJobAdapter.loadMoreModule.loadMoreComplete()
         mViewModel.mAllJobAdapter.loadMoreModule.isEnableLoadMore = false

+ 57 - 0
cs_cptServices/src/main/java/com/guadou/cs_cptservices/widget/MyStickRecyclerView.java

@@ -0,0 +1,57 @@
+package com.guadou.cs_cptservices.widget;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.MotionEvent;
+
+import androidx.annotation.Nullable;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.gavin.com.library.BaseDecoration;
+
+/**
+ * 适用于带悬停头的Recycle View 解决事件穿透问题
+ */
+public class MyStickRecyclerView extends RecyclerView {
+
+    private BaseDecoration mDecoration;
+
+    public MyStickRecyclerView(Context context) {
+        super(context);
+    }
+
+    public MyStickRecyclerView(Context context, @Nullable AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    public MyStickRecyclerView(Context context, @Nullable AttributeSet attrs, int defStyle) {
+        super(context, attrs, defStyle);
+    }
+
+    @Override
+    public void addItemDecoration(ItemDecoration decor) {
+        if (decor != null && decor instanceof BaseDecoration) {
+            mDecoration = (BaseDecoration) decor;
+        }
+        super.addItemDecoration(decor);
+    }
+
+    @Override
+    public boolean onInterceptTouchEvent(MotionEvent e) {
+        if (mDecoration != null) {
+            switch (e.getAction()) {
+                case MotionEvent.ACTION_DOWN:
+                    mDecoration.onEventDown(e);
+                    break;
+                case MotionEvent.ACTION_UP:
+                    if (mDecoration.onEventUp(e)) {
+                        return true;
+                    }
+                    break;
+                default:
+            }
+        }
+        return super.onInterceptTouchEvent(e);
+    }
+}
+

BIN
cs_cptServices/src/main/res/drawable-xxhdpi/history_title_red_calendar_icon.webp


+ 1 - 0
standalone/ewalletrunalone/src/main/java/com/guadou/ewalletrunalone/EWalletMainActivity.kt

@@ -7,6 +7,7 @@ import com.guadou.lib_baselib.base.activity.BaseVMActivity
 import com.guadou.lib_baselib.base.vm.EmptyViewModel
 import com.guadou.lib_baselib.utils.CommUtils
 import com.guadou.lib_baselib.utils.StatusBarUtils
+import com.hongyegroup.cpt_ewallet.ui.EWalletMainFragment
 
 /**
  * 独立运行模块的兼职Fragment的页面载体