package com.module.backstage.dialog

import android.content.Context
import com.hboxs.serialport.plc.DialogClickListener
import com.module.backstage.databinding.BackstageDialogDevonoffBinding
import com.quyunshuo.androidbaseframemvvm.base.mvvm.v.BaseFrameDialog

/**
 * 开关机的对话框
 */
class DevOnOffDialog(mContext: Context) : BaseFrameDialog<BackstageDialogDevonoffBinding>(mContext) {

    var type1:Int =1
    var type2:Int =2


    private var devOnoffDialoglistener: DialogClickListener? = null

    override fun BackstageDialogDevonoffBinding.initView() {
        tvBack.setOnClickListener {
            dismiss()
        }
        tvStartDev.setOnClickListener{
            devOnoffDialoglistener?.onClickListener(type1,null)
        }
        tvShutdown.setOnClickListener {
            devOnoffDialoglistener?.onClickListener(type2,null)

        }

    }

    override fun createVB() = BackstageDialogDevonoffBinding.inflate(layoutInflater)


    override fun initObserve() {
    }

    override fun initRequestData() {
    }

    fun setListener(listener: DialogClickListener) {
        this.devOnoffDialoglistener = listener
    }


}