package com.lukouguoji.aerologic.page.car.add

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

class CarDetailsActivity : BaseBindingActivity<ActivityCarAddBinding, CarDetailsViewModel>() {
    override fun layoutId(): Int {
        return R.layout.activity_car_add
    }

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

    override fun initOnCreate(savedInstanceState: Bundle?) {
        viewModel.initOnCreate(intent)
        setBackArrow("平板车${viewModel.pageType.value!!.title}")

        binding.viewModel = viewModel
    }

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


}