package com.yidianling.medical.popwindow

import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import android.widget.PopupWindow
import com.yidianling.im.R
import kotlinx.android.synthetic.main.medical_informed_dialog_layout.view.*


/**
 * Created by xj on 2019/10/14.
 */
class InformedConsentPopupWindow(context: Context,chatSettingClickListener:OnChatSettingClickListener) :
    PopupWindow(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) {
    init {
        val view =
            LayoutInflater.from(context).inflate(R.layout.medical_informed_dialog_layout, null)
        this.contentView = view
        this.isFocusable = true
        this.isOutsideTouchable = true

        view.close.setOnClickListener {
            chatSettingClickListener.onDismissAction()
            dismiss()
        }
        setOnDismissListener {
            chatSettingClickListener?.onDismissAction()
        }
    }

    interface OnChatSettingClickListener {
        fun onDismissAction() //取消
    }

}