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 androidx.recyclerview.widget.RecyclerView.LayoutManager
import com.dahe.gldriver.R
import com.dahe.gldriver.adapter.CarsAdapter
import com.dahe.gldriver.adapter.WaybillAdapter
import com.dahe.gldriver.databinding.ActivityCarsManBinding
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 CarsManActivity
 * @Author john
 * @Date 2024/2/1 08:59
 * @Description 车辆管理
 */
class CarsManActivity : BaseActivity<ActivityCarsManBinding>() {
    override fun initView(savedInstanceState: Bundle?) {
        setStatusBarColor(R.color.white)
        setTitleBar("车辆管理",true)


        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 = CarsAdapter()
            adapter as CarsAdapter
        }

        adapter.submitList(datas)
    }

    override fun initDate() {

    }
}