package com.lukouguoji.aerologic.page.transportLog.list

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


class TransportLogActivity :
    BaseBindingActivity<ActivityTransportLogListBinding, TransportLogViewModel>() {

    override fun layoutId(): Int {
        return R.layout.activity_transport_log_list
    }

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

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

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