package xn.xxp.home.leave

import android.os.Bundle
import com.dlc.eboard.ui.leave.LeaveFaceMatchingFragment
import core.ui.activity.BaseCountDownActivity
import http.vo.response.SignInCheckResp
import xn.xxp.R
import xn.xxp.databinding.ActivityLeaveBinding
import xn.xxp.widget.ITitleBar
import xn.xxp.widget.NavViewCompat

/**
 * 离开
 *
 * @author ReiChin_
 */
open class LeaveActivity :
    BaseCountDownActivity<ActivityLeaveBinding>() {

    override fun createViewBinding() = ActivityLeaveBinding.inflate(layoutInflater)

    override fun initViews(savedInstanceState: Bundle?) {
        super.initViews(savedInstanceState)
        showDefaultFragment()
    }

    override fun getMTitleBar(): ITitleBar {
        return binding.titleBar
    }

    override fun getMNavView(): NavViewCompat {
        return binding.navView
    }

    protected open fun showDefaultFragment() {
        val student: SignInCheckResp? = intent.getParcelableExtra("data")
        val transaction = supportFragmentManager.beginTransaction()
        transaction.add(R.id.container, LeaveFaceMatchingFragment.newInstance(student), LeaveFaceMatchingFragment.TAG)
        transaction.commitAllowingStateLoss()
    }

    override fun enabledBackCountDown() = true

}