左晓为主开发手持机充值管理机
zuojincheng
2025-04-03 d0a0e8e242e293ad35dfbee1217f1103302818cd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.dayu.general.adapter
 
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.dayu.baselibrary.databinding.ItemNoMoreBinding
 
/**
 * Description:
 * Author: zuo
 * Date: 2025/3/10
 */
abstract class BaseRecycleAdapter<T : RecyclerView.ViewHolder>:RecyclerView.Adapter<T>() {
    companion object {
        const val VIEW_TYPE_ITEM = 1
        const val VIEW_TYPE_EMPTY = 0
    }
 
    abstract override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): T
 
    abstract override fun getItemCount(): Int
 
//    abstract override fun onBindViewHolder(holder: T, position: Int)
//
    class ViewHolderEmpty(binding: ItemNoMoreBinding) : RecyclerView.ViewHolder(binding.root) {
        var mBinding: ItemNoMoreBinding = binding
        fun getBinding(): ItemNoMoreBinding {
            return mBinding
        }
 
        fun setBinding(binding: ItemNoMoreBinding) {
            this.mBinding = binding
        }
    }
}