package com.gh.gamecenter.message.view.message

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

/**
 * 消息中心-二级消息列表
 */
class MessageListActivity : ToolBarActivity() {
    override fun provideNormalIntent(): Intent? {
        return getTargetIntent(this, MessageListActivity::class.java, MessageListFragment::class.java)
    }

    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 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,
            type: String,
            name: String,
            gameId: String,
            gameName: String,
            gameType: String,
            entrance: String
        ): Intent {
            val bundle = Bundle()
            bundle.putString(EntranceConsts.KEY_TYPE, type)
            bundle.putString(EntranceConsts.KEY_NAME, name)
            bundle.putString(EntranceConsts.KEY_GAMEID, gameId)
            bundle.putString(EntranceConsts.KEY_GAMENAME, gameName)
            bundle.putString(EntranceConsts.KEY_GAME_TYPE, gameType)
            bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance)
            return getTargetIntent(
                context,
                MessageListActivity::class.java,
                MessageListFragment::class.java, bundle
            )
        }
    }
}