package com.gh.gamecenter.setting.view

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.setting.R

class SettingActivity : ToolBarActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        updateStatusBarColor(R.color.background_white, R.color.background_white)
    }

    override fun isAutoResetViewBackgroundEnabled() = true

    override fun onDarkModeChanged() {
        super.onDarkModeChanged()
        updateStatusBarColor(R.color.background_white, R.color.background_white)
    }

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

    companion object {
        fun getIntent(context: Context, isUpdate: Boolean, entrance: String): Intent {
            return getTargetIntent(
                context,
                SettingActivity::class.java,
                SettingsFragment::class.java, Bundle().apply {
                    putString(EntranceConsts.KEY_ENTRANCE, entrance)
                    putBoolean(EntranceConsts.KEY_VERSION_UPDATE, isUpdate)
                }
            )
        }
    }

}