package com.gh.gamecenter.game.upload

import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.therouter.router.Route
import com.gh.gamecenter.common.base.activity.BaseActivity
import com.gh.gamecenter.common.base.activity.ToolBarActivity
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.utils.updateStatusBarColor

/**
 * 游戏投稿
 */
@Route(path = RouteConsts.activity.gameSubmissionActivity)
class GameSubmissionActivity : ToolBarActivity() {
    companion object {
        @JvmStatic
        fun getIntent(context: Context, entrance: String, path: String): Intent {
            val bundle = Bundle()
            bundle.putString(EntranceConsts.KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
            return getTargetIntent(context, GameSubmissionActivity::class.java, GameUploadFragment::class.java, bundle)
        }
    }

    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, GameSubmissionActivity::class.java, GameUploadFragment::class.java)
    }

    override fun isAutoResetViewBackgroundEnabled(): Boolean = true

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