package com.gh.gamecenter.feedback.view.help

import android.os.Bundle
import androidx.fragment.app.Fragment
import com.therouter.router.Route
import com.gh.gamecenter.common.base.activity.BaseActivity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feedback.R
import com.therouter.router.Autowired

/**
 * 帮助与反馈
 */
@Route(path = RouteConsts.activity.helpAndFeedbackActivity)
class HelpAndFeedbackActivity : BaseActivity() {

    private var mTargetFragment: Fragment? = null

    override fun getLayoutId(): Int {
        return R.layout.activity_help_and_feedback
    }

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

        mTargetFragment = supportFragmentManager.findFragmentByTag(HelpAndFeedbackFragment::class.java.name)
            ?: HelpAndFeedbackFragment().with(intent.extras)
        supportFragmentManager.beginTransaction()
            .replace(R.id.placeholder, mTargetFragment!!, HelpAndFeedbackFragment::class.java.name)
            .commitAllowingStateLoss()
    }
}