package com.gh.gamecenter.servers.gametest2

import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.gh.gamecenter.common.base.activity.ToolBarActivity
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.utils.updateStatusBarColor
import com.gh.gamecenter.feature.exposure.ExposureEvent

/**
 * 新游开测
 */
class GameServerTestV2Activity : ToolBarActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        updateStatusBarColor(com.gh.gamecenter.common.R.color.ui_surface, com.gh.gamecenter.common.R.color.ui_surface)
    }

    override fun provideNormalIntent(): Intent {
        return getTargetIntent(this, GameServerTestV2Activity::class.java, GameServerTestV2Fragment::class.java)
    }

    override fun onDarkModeChanged() {
        super.onDarkModeChanged()
        updateStatusBarColor(com.gh.gamecenter.common.R.color.ui_surface, com.gh.gamecenter.common.R.color.ui_surface)
    }

    companion object {
        fun getIntent(context: Context, linkId: String, entrance: String, exposureEvent: ExposureEvent? = null): Intent {
            val bundle = Bundle()
            bundle.putString(EntranceConsts.KEY_ID, linkId)
            bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance)
            exposureEvent?.let {
                bundle.putParcelableArrayList(
                    EntranceConsts.KEY_EXPOSURE_SOURCE_LIST,
                    ArrayList(exposureEvent.source)
                )
            }
            return getTargetIntent(
                context,
                GameServerTestV2Activity::class.java,
                GameServerTestV2Fragment::class.java,
                bundle
            )
        }
    }
}