package com.pan_american.android.ui.personnel_module.materials_operate

import android.os.Bundle
import com.pan_american.android.R
import com.pan_american.android.base.BaseActivity
import com.pan_american.android.databinding.ActivityMaterialApplicationHistoryBinding
import com.pan_american.android.databinding.LayoutTitleBinding

class MaterialApplicationHistoryActivity : BaseActivity<ActivityMaterialApplicationHistoryBinding>() {

    private lateinit var titleBinding: LayoutTitleBinding

    override fun getViewBinding() = ActivityMaterialApplicationHistoryBinding.inflate(layoutInflater)

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        initTitle()
        initViews()
    }

    override fun initTitle() {
        titleBinding = LayoutTitleBinding.bind(binding.root).apply {
            titleText.text = resources.getString(R.string.material_application_history)

            backButton.setOnClickListener {
                back()
            }
        }
    }

    override fun initViews() {
        supportFragmentManager.beginTransaction().addToBackStack(null)
            .add(binding.materialHistoryContainer.id, MaterialHistorySearchFragment()).commit()
    }
}