package com.pan_american.android.ui.group_hotel.hotel_predetermine

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.ActivityHotelPredetermineBinding
import com.pan_american.android.databinding.LayoutTitleBinding
import com.pan_american.android.ui.group_simple_info.GroupSimpleInfoFragment

class HotelPredetermineActivity : BaseActivity<ActivityHotelPredetermineBinding>() {

    private lateinit var titleBinding: LayoutTitleBinding

    override fun getViewBinding() = ActivityHotelPredetermineBinding.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.hotel_predetermine)
        }

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

        val groupSimpleInfoFragment = GroupSimpleInfoFragment()
        groupSimpleInfoFragment.arguments = bundle

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

    override fun initEvents() {

        titleBinding.backButton.setOnClickListener {
            back()
        }

    }
}