package com.gh.gamecenter.video.poster

import android.graphics.Color
import android.os.Bundle
import com.gh.gamecenter.R
import com.gh.gamecenter.common.base.activity.BaseActivity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.video.poster.video.VideoPosterFragment
import com.therouter.TheRouter
import com.therouter.router.Route

@Route(path = RouteConsts.activity.videoCoverEditActivity)
class PosterEditActivity : BaseActivity() {

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

    override fun onCreate(savedInstanceState: Bundle?) {
        TheRouter.inject(this)
        super.onCreate(savedInstanceState)
        DisplayUtils.setLightStatusBar(this, false)
        setStatusBarColor(Color.TRANSPARENT)

        val tag = VideoPosterFragment::class.java.name
        val fragment = supportFragmentManager.findFragmentByTag(tag) ?: VideoPosterFragment.newInstance()
        fragment.arguments = intent.extras
        supportFragmentManager
            .beginTransaction()
            .replace(R.id.fcv_container, fragment, tag)
            .commitNowAllowingStateLoss()
    }
}