package com.lukouguoji.gnc.page.deposit.list

import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Route
import com.lukouguoji.gnc.R
import com.lukouguoji.gnc.databinding.ActivityGncDepositListBinding
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.ktx.getLifecycleOwner
import com.lukouguoji.module_base.router.ARouterConstants

@Route(path = ARouterConstants.ACTIVITY_URL_GNC_DEPOSIT)
class GncDepositListActivity :
    BaseBindingActivity<ActivityGncDepositListBinding, GncDepositListViewModel>() {

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

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

    override fun initOnCreate(savedInstanceState: Bundle?) {
        setBackArrow("国内出港存放")
        binding.viewModel = viewModel
        viewModel.pageModel.bindSmartRefreshLayout(
            binding.srl,
            binding.rv,
            viewModel,
            getLifecycleOwner()
        )
        viewModel.refresh()
    }

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

}