package com.gh.gamecenter.qa.editor

import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.core.os.bundleOf
import androidx.fragment.app.Fragment
import com.gh.gamecenter.common.base.activity.BaseActivity_TabLayout
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.R
import com.gh.gamecenter.collection.VideoFragment
import com.gh.gamecenter.common.utils.updateStatusBarColor

class InsertVideoWrapperActivity : BaseActivity_TabLayout() {

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

    override fun getLayoutId(): Int = R.layout.activity_tablayout_no_title_viewpager

    override fun initFragmentList(fragments: MutableList<Fragment>?) {
        fragments?.add(
            VideoFragment().with(
                bundleOf(
                    "videoStyle" to VideoFragment.VideoStyle.MINE.value,
                    EntranceConsts.KEY_INSERT_BBS_VIDEO to true
                )
            )
        )
        fragments?.add(
            VideoFragment().with(
                bundleOf(
                    "videoStyle" to VideoFragment.VideoStyle.COLLECT.value,
                    EntranceConsts.KEY_INSERT_BBS_VIDEO to true
                )
            )
        )
    }

    override fun initTabTitleList(tabTitleList: MutableList<String>?) {
        tabTitleList?.add("我的视频贴")
        tabTitleList?.add("收藏视频帖")
    }

    override fun isAutoResetViewBackgroundEnabled(): Boolean = true

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

    companion object {
        fun getIntent(context: Context): Intent {
            return Intent(context, InsertVideoWrapperActivity::class.java)
        }
    }
}