package com.lukouguoji.aerologic.page.accident.visa.details

import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.lukouguoji.aerologic.R
import com.lukouguoji.aerologic.databinding.ActivityAccidentVisaDetailsBinding
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.bean.FileBean
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.common.DetailsPageType
import com.lukouguoji.module_base.ktx.addOnItemClickListener
import com.lukouguoji.module_base.ktx.commonAdapter

class AccidentVisaDetailsActivity :
    BaseBindingActivity<ActivityAccidentVisaDetailsBinding, AccidentVisaDetailsViewModel>() {

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

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

    override fun initOnCreate(savedInstanceState: Bundle?) {
        viewModel.rv = binding.rv
        viewModel.initOnCreate(intent)

        setBackArrow("国内事故签证${viewModel.pageType.value!!.title}")
        binding.viewModel = viewModel

        binding.rv.addOnItemClickListener(viewModel)
    }

    companion object {
        @JvmStatic
        fun start(context: Context, id: String = "", editable: Boolean = id.isEmpty()) {
            val starter = Intent(context, AccidentVisaDetailsActivity::class.java)
                .putExtra(Constant.Key.ID, id)
                .putExtra(Constant.Key.DATA, editable)
            context.startActivity(starter)
        }
    }
}