package com.gh.gamecenter.qa.answer.detail

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

class SimpleAnswerDetailActivity : ToolBarActivity() {

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

    override fun provideNormalIntent(): Intent? {
        return getTargetIntent(
            this,
            SimpleAnswerDetailActivity::class.java,
            SimpleAnswerDetailFragment::class.java
        )
    }

    override fun isAutoResetViewBackgroundEnabled(): Boolean = true

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

    companion object {
        @JvmStatic
        fun getIntent(context: Context, answerId: String, entrance: String, path: String): Intent {
            val bundle = Bundle()
            bundle.putString(EntranceConsts.KEY_ANSWER_ID, answerId)
            bundle.putString(EntranceConsts.KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
            bundle.putString(EntranceConsts.KEY_PATH, path)
            return getTargetIntent(
                context,
                SimpleAnswerDetailActivity::class.java,
                SimpleAnswerDetailFragment::class.java,
                bundle
            )
        }
    }
}