package com.lukouguoji.aerologic.page.uld.edit

import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.lukouguoji.aerologic.R
import com.lukouguoji.aerologic.databinding.ActivityUldEditBinding
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.common.Constant

class UldEditActivity : BaseBindingActivity<ActivityUldEditBinding, UldEditViewModel>() {

    override fun layoutId() = R.layout.activity_uld_edit

    override fun viewModelClass() = UldEditViewModel::class.java

    override fun initOnCreate(savedInstanceState: Bundle?) {
        viewModel.initOnCreate(intent)
        setBackArrow("ULD${viewModel.pageType.value!!.title}")
        binding.viewModel = viewModel
    }

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