package com.gh.gamecenter.video.data

import android.os.Bundle
import com.gh.gamecenter.common.base.activity.BaseActivity
import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.R

/**
 * 视频数据
 */
class VideoDataActivity : BaseActivity() {
    override fun getLayoutId(): Int {
        return R.layout.activity_amway
    }

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

        DisplayUtils.transparentStatusBar(this)

        val containerFragment = supportFragmentManager.findFragmentByTag(VideoDataFragment::class.java.name)
            ?: VideoDataFragment().with(intent.extras)
        // 若 placeholder 外层为 RelativeLayout 的话，会出现莫名的偏移
        supportFragmentManager.beginTransaction()
            .replace(R.id.placeholder, containerFragment, VideoDataFragment::class.java.name)
            .commitAllowingStateLoss()
    }

    override fun isAutoResetViewBackgroundEnabled(): Boolean = true
}