package com.lukouguoji.aerologic.page.gnj.query.list

import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.lukouguoji.aerologic.R
import com.lukouguoji.aerologic.databinding.ActivityGnjQueryListBinding
import com.lukouguoji.aerologic.databinding.ActivityGnjStashListBinding
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.ktx.addOnItemClickListener
import com.lukouguoji.module_base.ktx.getLifecycleOwner
import dev.utils.app.CrashUtils

class GnjQueryListActivity :
    BaseBindingActivity<ActivityGnjQueryListBinding, GnjQueryListViewModel>() {

    override fun layoutId() = R.layout.activity_gnj_query_list

    override fun viewModelClass() = GnjQueryListViewModel::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, GnjQueryListActivity::class.java)
            context.startActivity(starter)
        }
    }

}