package com.lukouguoji.aerologic.page.transport

import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.lukouguoji.aerologic.R
import com.lukouguoji.aerologic.databinding.ActivityGoodsTransportBinding
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.ktx.addOnItemClickListener
import com.lukouguoji.module_base.ktx.getLifecycleOwner

class GoodsTransportActivity :
    BaseBindingActivity<ActivityGoodsTransportBinding, GoodsTransportViewModel>() {
    override fun layoutId(): Int {
        return R.layout.activity_goods_transport
    }

    override fun viewModelClass(): Class<GoodsTransportViewModel> {
        return GoodsTransportViewModel::class.java
    }

    override fun initOnCreate(savedInstanceState: Bundle?) {
        setBackArrow("货物转运")
        binding.viewModel = viewModel
        viewModel.pageModel.bindSmartRefreshLayout(
            binding.srl,
            binding.rv,
            viewModel,
            getLifecycleOwner()
        )
        binding.rv.addOnItemClickListener(viewModel)
    }

    companion object {
        @JvmStatic
        fun start(context: Context) {
            val starter = Intent(context, GoodsTransportActivity::class.java)
            context.startActivity(starter)
        }
    }
}