package com.gh.gamecenter.setting.view.security

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 SecurityActivity : ToolBarActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setNavigationTitle(R.string.setting_security)
        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)
    }

    companion object {

        @JvmStatic
        fun getIntent(context: Context, entrance: String, isLogoutStyle: Boolean = false): Intent {
            val bundle = Bundle()
            bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance)
            bundle.putString(
                SecurityFragment.DISPLAY_TYPE,
                if (isLogoutStyle) {
                    SecurityFragment.DisplayType.LOGOUT.value
                } else {
                    SecurityFragment.DisplayType.DEFAULT.value
                }
            )
            return getTargetIntent(context, SecurityActivity::class.java, SecurityFragment::class.java, bundle)
        }

    }
}