package com.pan_american.android.ui.group_airplane_ticket.airplane_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.ActivityGroupAirplaneTicketInsertBinding
import com.pan_american.android.databinding.LayoutTitleBinding
import com.pan_american.android.ui.group_simple_info.GroupSimpleInfoFragment

class AirplaneTicketPaymentActivity : BaseActivity<ActivityGroupAirplaneTicketInsertBinding>() {

    private lateinit var titleBinding: LayoutTitleBinding

    override fun getViewBinding() = ActivityGroupAirplaneTicketInsertBinding.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.airplane_payment_insert)
            backButton.setOnClickListener {
                back()
            }
        }
    }

    override fun initViews() {
        val bundle = Bundle().apply {
            putInt("id", OASystem.C_TABLE_AIRPLANE_TICKET)
        }

        val groupSimpleInfoFragment = GroupSimpleInfoFragment()
        groupSimpleInfoFragment.arguments = bundle

        supportFragmentManager.beginTransaction().addToBackStack(null)
            .add(binding.airplaneTicketFragmentContainer.id, groupSimpleInfoFragment).commit()
    }
}