package com.lukouguoji.gnc.page.shouyun.unlist

import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.text.TextWatcher
import android.widget.EditText
import com.lukouguoji.gnc.R
import com.lukouguoji.gnc.databinding.ActivityShouyunListBinding
import com.lukouguoji.gnc.databinding.ActivityShouyunUnListBinding
import com.lukouguoji.gnc.page.shouyun.list.GncShouYunListActivity
import com.lukouguoji.gnc.page.shouyun.list.GncShouYunListViewModel
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.ktx.addOnItemClickListener
import com.lukouguoji.module_base.ktx.getLifecycleOwner

class GncShouYunUnListActivity :
    BaseBindingActivity<ActivityShouyunUnListBinding, GncShouYunUnListViewModel>() {

    override fun layoutId() = R.layout.activity_shouyun_un_list

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

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

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

        binding.rv.addOnItemClickListener(viewModel)

    }

    override fun onResume() {
        super.onResume()
        viewModel.refresh()
    }

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

}