package com.lukouguoji.gnc.page.assemble.unload

import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.lukouguoji.gnc.R
import com.lukouguoji.gnc.databinding.ActivityGncAssembleUnloadListBinding
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.ktx.getLifecycleOwner
import com.lukouguoji.module_base.ktx.refresh

class GncAssembleUnloadListActivity :
    BaseBindingActivity<ActivityGncAssembleUnloadListBinding, GncAssembleUnloadListViewModel>() {

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

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

    override fun initOnCreate(savedInstanceState: Bundle?) {
        setBackArrow("国内出港待装货物")
        binding.viewModel = viewModel

        viewModel.pageModel.bindSmartRefreshLayout(
            binding.srl,
            binding.rv,
            viewModel,
            getLifecycleOwner()
        )

        viewModel.initOnCreated(intent)
    }
    
    companion object{
        @JvmStatic
        fun start(context: Context, modify: Boolean = true) {
            val starter = Intent(context, GncAssembleUnloadListActivity::class.java).putExtra(
                Constant.Key.MODIFY, modify)
            context.startActivity(starter)
        }
    }
}