package com.gh.gamecenter.category

import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.gh.base.DownloadToolbarActivity
import com.gh.gamecenter.R
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.utils.updateStatusBarColor

class CategoryDirectoryActivity : DownloadToolbarActivity() {

    companion object {
        fun getIntent(context: Context, categoryId: String, categoryTitle: String): Intent {
            val bundle = Bundle()
            bundle.putString(EntranceConsts.KEY_CATEGORY_ID, categoryId)
            bundle.putString(EntranceConsts.KEY_CATEGORY_TITLE, categoryTitle)
            return getTargetIntent(
                context,
                CategoryDirectoryActivity::class.java,
                CategoryDirectoryFragment::class.java,
                bundle
            )
        }
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setToolbarMenu(R.menu.menu_download)
        updateStatusBarColor(R.color.background_white, R.color.background_white)
    }

    override fun showDownloadMenu(): Boolean {
        return true
    }

    override fun getActivityNameInChinese(): String {
        return "游戏分类"
    }

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

    override fun isAutoResetViewBackgroundEnabled() = true

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