package com.dahe.gldriver.ui.mine.activity

import android.graphics.Color
import android.os.Bundle
import android.widget.LinearLayout
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.dahe.gldriver.adapter.CarsAdapter
import com.dahe.gldriver.adapter.WalletAdapter
import com.dahe.gldriver.databinding.ActivityWalletBinding
import com.dahe.glex.bean.WayBillBean
import com.dahe.mylibrary.base.BaseActivity
import com.dahe.mylibrary.recycleviewswipe.RecycleViewDivider
import com.dahe.mylibrary.utils.ConvertUtils

/**
 * @ClassName WalletActivity
 * @Author john
 * @Date 2024/2/1 09:41
 * @Description 钱包
 */
class WalletActivity : BaseActivity<ActivityWalletBinding>() {
    override fun initView(savedInstanceState: Bundle?) {
        setStatusHeightParams(binding.rlTop)
        setTitleBar("钱包",true,true)
    }

    override fun initDate() {

        var datas = mutableListOf<WayBillBean>(
            WayBillBean(),
            WayBillBean(),
            WayBillBean(),
            WayBillBean(),
            WayBillBean(),
            WayBillBean(),
            WayBillBean(),
            WayBillBean()
        )

        var adapter = binding.recycler.run {
            layoutManager = LinearLayoutManager(mContext, RecyclerView.VERTICAL, false)
            addItemDecoration(
                RecycleViewDivider(
                    LinearLayout.VERTICAL,
                    ConvertUtils.dp2px(16.0f),
                    Color.TRANSPARENT
                )
            )
            adapter = WalletAdapter()
            adapter as WalletAdapter
        }

        adapter.submitList(datas)
    }
}