package com.gh.gamecenter.feedback.view.qa

import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.therouter.router.Route
import com.gh.gamecenter.common.base.activity.ToolBarActivity
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.utils.updateStatusBarColor

/**
 * 帮助与反馈-帮助中心-查看更多
 */
@Route(path = RouteConsts.activity.qaActivity)
class QaActivity : ToolBarActivity() {

    companion object {
        /**
         * 帮助与反馈-帮助中心-查看更多
         */
        fun getNewIntent(
            context: Context,
            navigationTitle: String,
            categoryId: String? = null,
            isMyRelatedQA: Boolean = false
        ): Intent {
            val args = Bundle()
            args.putString(EntranceConsts.KEY_CATEGORY_ID, categoryId)
            args.putString(EntranceConsts.KEY_NAVIGATION_TITLE, navigationTitle)
            args.putBoolean(EntranceConsts.KEY_MY_RELATED_QA, isMyRelatedQA)
            return getTargetIntent(context, QaActivity::class.java, HelpContainerFragment::class.java, args)
        }
    }

    override fun provideNormalIntent(): Intent {
        return getTargetIntent(this, QaActivity::class.java, HelpContainerFragment::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 isAutoResetViewBackgroundEnabled() = true

    override fun onDarkModeChanged() {
        super.onDarkModeChanged()
        updateStatusBarColor(com.gh.gamecenter.common.R.color.ui_surface, com.gh.gamecenter.common.R.color.ui_surface)
    }
}