package com.baijiayun.live.ui.preview

import android.os.Bundle
import com.baijiayun.liveuibase.utils.getResolutionList
import com.baijiayun.liveuibase.utils.getRouterViewModel
import com.baijiayun.liveuibase.widgets.setting.BaseSettingFragment
import com.baijiayun.liveuibase.widgets.setting.fragment.SettingCameraFragment

/**
 * @author        chenfu
 * @date          2023/4/6
 * description：
 */
class SettingCameraDialogFragment : PreviewSettingDialogFragment() {

    override fun getSettingFragment(): BaseSettingFragment {
        val fragment = SettingCameraFragment()
        fragment.setRouterViewModel(getRouterViewModel())
        return fragment
    }

    override fun realWindowWidth(): Int {
        val size = getResolutionList(getRouterViewModel()!!.liveRoom).size
        return if (size > 2) {
            super.realWindowWidth() + 15 * (size - 2)
        } else {
            super.realWindowWidth()
        }
    }

    companion object {
        fun newInstance(): SettingCameraDialogFragment {
            val args = Bundle()
            val fragment = SettingCameraDialogFragment()
            fragment.arguments = args
            return fragment
        }
    }
}