package com.pan_american.android.ui.group_op.ground_convey_payment_insert

import android.os.Bundle
import com.pan_american.android.OASystem
import com.pan_american.android.R
import com.pan_american.android.base.BaseActivity
import com.pan_american.android.databinding.ActivityGroupOpPaymentBinding
import com.pan_american.android.databinding.LayoutTitleBinding
import com.pan_american.android.ui.group_simple_info.GroupSimpleInfoFragment

class GroundConveyPaymentInsertActivity : BaseActivity<ActivityGroupOpPaymentBinding>() {

    private lateinit var titleBinding: LayoutTitleBinding

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

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

        initViews()
        initEvents()
    }

    override fun initViews() {
        titleBinding = LayoutTitleBinding.bind(binding.root).apply {
            titleText.text = resources.getString(R.string.ground_convey_payment_insert)
        }

        val bundle = Bundle().apply {
            putInt("id", OASystem.C_TABLE_GROUND_CONVEY)
        }

        val groupSimpleInfoFragment = GroupSimpleInfoFragment()
        groupSimpleInfoFragment.arguments = bundle

        supportFragmentManager.beginTransaction().addToBackStack(null)
            .replace(binding.groupOpFragmentContainer.id, groupSimpleInfoFragment).commit()
    }

    override fun initEvents() {

        titleBinding.backButton.setOnClickListener {
            back()
        }

    }
}