package com.gh.gamecenter

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.RouteConsts
import com.gh.gamecenter.common.utils.updateStatusBarColor
import com.halo.assistant.fragment.user.UserInfoFragment
import com.therouter.router.Route

@Route(
    path = RouteConsts.activity.userInfoActivity,
    description = "个人中心"
)
class UserInfoActivity : 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,
            UserInfoActivity::class.java,
            UserInfoFragment::class.java
        )
    }

    companion object {
        fun getIntent(context: Context?): Intent? {
            return getTargetIntent(
                context,
                UserInfoActivity::class.java,
                UserInfoFragment::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)
    }
}