package com.sd.cavphmi.base

import android.view.ViewGroup
import androidx.fragment.app.DialogFragment
import com.sd.cavphmi.utils.SystemUtils


open class BaseDialogFrament : DialogFragment() {

    override fun onStart() {
        super.onStart()
//        var window = dialog?.window
//        window?.setBackgroundDrawableResource(R.color.trans)

//        setWidth()
    }

    /**
     * 设置对话款高度
     */
    fun setWidth(widthPer: Float = 0.8f) {
        var dialogWidth = SystemUtils.getScreenWidth().times(widthPer).toInt()
        dialog?.window?.setLayout(dialogWidth, ViewGroup.LayoutParams.WRAP_CONTENT)
    }
}