SafeHelpRemindDialog.kt 1.02 KB
Newer Older
konghaorui committed
1 2 3 4 5 6 7
package com.yidianling.uikit.custom.widget

import android.app.Dialog
import android.content.Context
import android.os.Bundle
import android.view.WindowManager
import com.yidianling.im.R
konghaorui committed
8
import kotlinx.android.synthetic.main.im_safe_help_remind_dialog_layout.*
konghaorui committed
9 10 11 12 13 14 15 16 17

/**
 * Created by xj on 2019/8/7.
 */
class SafeHelpRemindDialog(val mContext: Context, val listener: SafeHelpRemindListener): Dialog(mContext, R.style.dialog_default_style) {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

konghaorui committed
18
        setContentView(R.layout.im_safe_help_remind_dialog_layout)
konghaorui committed
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38

        val params = window.attributes
        params.width = WindowManager.LayoutParams.MATCH_PARENT
        params.height = WindowManager.LayoutParams.MATCH_PARENT
        window.attributes = params

        safe_help_remind_cancel.setOnClickListener { hide() }

        safe_help_remind_sure.setOnClickListener {
            listener?.sureClick()
        }


    }

    interface SafeHelpRemindListener{
        fun sureClick()
    }

}