package com.example.base.livedata

import com.example.base.bean.DialogBean

/**
 * @date 2020-06-05 13:51
 * @desc 对话框显示隐藏liveData
 */

class DialogLiveEvent : SingleLiveEvent<DialogBean>() {

    private val bean = DialogBean()

    fun setValue(isShow: Boolean, cancelable: Boolean = false) {
        bean.isShow = isShow
        bean.cancelable = cancelable
//        bean.msg = ""
        value = bean
    }

    fun setValue(isShow: Boolean, msg: String, cancelable: Boolean = false) {
        bean.isShow = isShow
        bean.msg = msg
        bean.cancelable = cancelable
        value = bean
    }
}